H
Helpfuldarren
I have just upgraded from vb6 to vb.net. bought myself a book. not a very
good one !
In vb6 to execute the code on form1(command1) from form2 the code would be
form1.command1 = true ' that easy
According to my .net book it should be totally changed to something like.
FORM1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim nefrm As New Form2
Me.AddOwnedForm(nefrm)
nefrm.Show()
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' code here for button 1
Stop ' halt program
End Sub
-----------------------------------------------------------------------------------------------
FORM2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim oldfrm As Form1
oldfrm = Me.Owner
oldfrm.Button1.Visible = False ' this works
'************WHAT SHOULD I DO TO EXECUTE THE CLICK EVENT******************
'***********oldfrm.button1.value = true******************** wont code
End Sub
i'm sure its quite simple to someone who knows.
good one !
In vb6 to execute the code on form1(command1) from form2 the code would be
form1.command1 = true ' that easy
According to my .net book it should be totally changed to something like.
FORM1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim nefrm As New Form2
Me.AddOwnedForm(nefrm)
nefrm.Show()
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' code here for button 1
Stop ' halt program
End Sub
-----------------------------------------------------------------------------------------------
FORM2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim oldfrm As Form1
oldfrm = Me.Owner
oldfrm.Button1.Visible = False ' this works
'************WHAT SHOULD I DO TO EXECUTE THE CLICK EVENT******************
'***********oldfrm.button1.value = true******************** wont code
End Sub
i'm sure its quite simple to someone who knows.