Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> button.Select
All, I appear to have a mind block at the moment. Could someone help me out
and get me over this hurdle.
When repeatNo is 0, I see the 6th button selected as expected. When repeatNo is >0, it isn't. For goodness sakes, why?
Thank you
Hexathioorthooxalate
Public Class Form1
Inherits System.Windows.Forms.Form
'+ Windows Form Designer generated code
Private Class btnExtend
Inherits Button
End Class
Private Sub clearButtons()
For Each o As Object In Me.Controls If TypeOf o Is btnExtend Then Me.Controls.Remove(o) Next
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click Dim btn As Button For repeatNo As Integer = 0 To 5 clearButtons() For buttonCounter As Integer = 0 To 9 btn = New Button btn.Size = New Size(10, 10) btn.Top = 20 btn.Left = buttonCounter * 15 Me.Controls.Add(btn) If buttonCounter = 5 Then btn.Select() Next buttonCounter MsgBox("complete" + repeatNo.ToString()) Next repeatNo
![]() |
![]() |