1

と を含む Windows フォームがありbuttonますdatagridview。を選択するとbutton、スレッドが開始され、それが何かを実行し、最終的に私のdatagridview. 問題は、datagridviewが満たされていないことです。

私は何を間違っていますか?

私のコード:

Private MyCreateStructureFromSampleXMLTread As Thread

Private Sub ButtonCreateStructureFromSampleXML_Click(sender As Object, e As EventArgs) Handles ButtonCreateStructureFromSampleXML.Click
    Me.Cursor = Cursors.WaitCursor
    MyCreateStructureFromSampleXMLTread = New Thread(AddressOf ModuleXML_MESSAGE_STRUCTURE.CreateStructureFromSampleXML)
    MyCreateStructureFromSampleXMLTread.IsBackground = True
    MyCreateStructureFromSampleXMLTread.SetApartmentState(ApartmentState.STA)
    MyCreateStructureFromSampleXMLTread.Start()
    Me.Cursor = Cursors.Default
End Sub

スレッド:

    Friend Sub CreateStructureFromSampleXML()
    FormUTool.Cursor = Cursors.WaitCursor
    Try
        If ModuleFileHandling.OpenFile(Application.StartupPath, "Select XML File", ".xml", "XML File (*.xml)|*.xml") = True Then
            ParseXMLFile(PublicUToolVariable.MyOpenedFile)
        End If
    Catch ex As Exception
        MsgBox(ex.Message, MsgBoxStyle.Critical)
    End Try
    ModuleXML_MESSAGE_STRUCTURE.AlignElementPaths(PublicUToolVariable.MyAccessConnection)
    ModuleXML_MESSAGE_STRUCTURE.XML_MESSAGE_STRUCTUREFillDataGridView(PublicUToolVariable.MyAccessConnection)
    FormUTool.Cursor = Cursors.Default
End Sub
4

1 に答える 1