R
Rob
I am reading a book that says that the "name" property can be altered only
at design time and cannot be modified at runtime.
Please explain this given the code below...
If you click Button3... fred will appear as the Name of Button1, however,
the handler for Button1 works still works as well...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MsgBox("HELP")
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Button1.Name = "fred"
Dim i As Integer = 0
Dim str As String
While i < Me.Controls.Count
Dim c As Control = Me.Controls(i)
str = c.Name
MsgBox(str)
i = i + 1
End While
End Sub
at design time and cannot be modified at runtime.
Please explain this given the code below...
If you click Button3... fred will appear as the Name of Button1, however,
the handler for Button1 works still works as well...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MsgBox("HELP")
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Button1.Name = "fred"
Dim i As Integer = 0
Dim str As String
While i < Me.Controls.Count
Dim c As Control = Me.Controls(i)
str = c.Name
MsgBox(str)
i = i + 1
End While
End Sub