Reputation: 3
I get a doubt about Class Library application type, so I need help on this.
I get a software I can add plugin to. I want to make this plugin in VB.NET using Visual Studio 2010. The software only accept class library application type only and I need to display a Form with a Combobox in order for the user to pickup a value in a list.
In the main class that is first launched when the software calls the plugin. I launch a Windows Form in the code below the object's name is objListValidation. My problem is that when I do the Me.Show() it displays the window, but it's going to the end of the CompareToList function and doesn't stop there.
Code that launch the Win Form:
Public objListValidation As ListValidation
objListValidation = New ListValidation
objListValidation.CompareToList("SELECT <NOM_CHAMP> FROM <NOM_TABLE>")
Code that display the Win Form:
Public Sub CompareToList(ByVal qryStr As String, Optional ByVal isBloquant As Boolean = False)
Dim alCompteGeneraux As New ArrayList
Dim isExistsInList As Boolean = False
Dim objConnectDB2 As New ConnectDB2
Dim i As Integer = 0
If Not isBloquant Then btnCancel.Visible = True : manageButtonsPosition() Else mstrIsBloquant = True
al.Add("AAA")
al.Add("VVVV")
al.Add("BBBB")
For i = 0 To al.Count - 1
If al.Item(i).ToString = mstrObjInvoiceField.DisplayString Then isExistsInList = True
Next
If Not isExistsInList Then
Me.Text = "Liste de choix pour le champ : " + mstrObjInvoiceField.Name
lblTitle.Text = "Veuillez choisir dans la liste une valeur pour le champ : " + mstrObjInvoiceField.Name
cbList.DataSource = al
Me.Show()
Else
validation()
End If
End Sub
Upvotes: 0
Views: 207
Reputation: 887453
You probably want to call Me.ShowDialog()
, which won't return until the user closes the dialog.
Upvotes: 1