I'm very new to visual basic and I'm stuck at transfering the text from one label on a form to another via a button click event
I have 2 forms which I will call A and B. On form A I have a menu which when clicked brings up form B which has a button and a label. When I click on the button I want to transfer the text from that label to a label on form A.
I tried doing the following but have no luck, as form A doesn't update the information
Public Sub okButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles okButton.Click Dim pie As New Puzzle If ListBox1.SelectedIndex = 0 Then label1.text = 50 pie.label1.text = label1.text me.close() ElseIf Listbox1.SelectedIndex = 1 then label1.text = 75 pie.label1.text = label1.text me.close() elseIf ListBox1.selectedIndex = 2 then label1.text = 100 pie.label1.text = label1.text me.close End If End Sub
Edited 4 Years Ago by pritaeas: moved.