Lstbox1 on my main form is blank, and lstbox2 on the second form has 3 items in it that has a price on it.
Here is my code on the second form.
strItem = lstPrint.SelectedItem.ToString() Select Case(lstBox2.SelectedIndex) Case 0 g_sngPrint = 5 Case 1 g_sngPrint = 10 Case 2 g_sngPrint = 15 End Select
Here is my module
Module MainModule Public strItem As String Public intVal As Integer End Module
And here's my main form
Private Sub MainForm_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated Dim total as integer lstProduct.Items.Add(strItem) End Sub
When I return to the main form, the string from the lstbox on my second form should be added to the listbox on the first form. Also when I return, it should calculate values, but I'll worry about that later.
My problem is that if I use an activated event, I notice that if I have a message box pop up by clicking a button, it will add the item in the variable again. But if I use a load event, it doesn't function at all. I think I still need to be using a activated or load event so the mainform will update when I add items from the other listbox, but I'm still doing it wrong?