How do I reference a runtime-created button that was pressed?
I've created five buttons with the following code:
Now I'm working with the PnlNavigatorButton_Click procedure. I imagine that it would look something like:Code:For i As Integer = 0 To 4 Dim PnlNavigatorButton As New System.Windows.Forms.Button Dim ButtonNames() As String = {"Search", "Supervising", "Shipping", "Production", "Data Entry"} With PnlNavigatorButton .Visible = True .Location = New System.Drawing.Point(15, 75 + x) .Size = New Size(96, 32) .Text = ButtonNames(i) End With pnlTabNavigator.Controls.Add(PnlNavigatorButton) x += 32 AddHandler PnlNavigatorButton.Click, AddressOf PnlNavigatorButton_Click Next
I just don't know how to reference the system event of a button click to perform the if-then test. I know I've seen it somewhere, somewhen, but my dog ate my map back there...Code:Dim control As Control For Each control In pnlTabNavigator.Controls If control = 'Here's what I'm Missing NextI keep thinking it's something like "e.buttonClicked" but none of that shows up in intellisense.




I keep thinking it's something like "e.buttonClicked" but none of that shows up in intellisense.
Reply With Quote