I've converted an app from VB6 to Express and I'm having trouble
getting the the array index of the dynamically created buttons when
the user clicks the button. In other words in VB6 in order to dynamically
create buttons on the fly you would first create an array of buttons
in the design view haveing the same name. Then in the source click event,
the index of the button that was clicked would be given in the index as
shown below is the old VB6 Subroutine:
----------------
The Express converter converted the code to
So I can't build the code (error free) with option strict on and use the
statement:
Dim index As Short = DynButton.GetIndex(eventSender)
but I need the index and I want to use strick on
Thanks
getting the the array index of the dynamically created buttons when
the user clicks the button. In other words in VB6 in order to dynamically
create buttons on the fly you would first create an array of buttons
in the design view haveing the same name. Then in the source click event,
the index of the button that was clicked would be given in the index as
shown below is the old VB6 Subroutine:
VB.NET:
Private Sub DynButton_Click([COLOR=red]index[/COLOR] As Integer)
'The [COLOR=red]index[/COLOR] provides the index of which array of button was clicked
'...
end Sub
----------------
The Express converter converted the code to
VB.NET:
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] DynButton_Click([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] eventSender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] eventArgs [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] DynButton.Click
[/SIZE]Dim [COLOR=red]index[/COLOR] As Short = DynButton.GetIndex(eventSender)
'above has no warnings but errors when I set option strict on
'...
end sub
So I can't build the code (error free) with option strict on and use the
statement:
Dim index As Short = DynButton.GetIndex(eventSender)
but I need the index and I want to use strick on
Thanks