Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

Array controllers

$
0
0
I want to create an array controllers, that I can control them after they created ..
PHP Code:

    Dim NewLoc As Integer
    
Private Btn() As Button
    
Private Sub Button1_Click(sender As ObjectAs EventArgsHandles Button1.Click
        
For 0 To 10
            NewLoc 
+= 40
            Btn
(i) = New Button
            Btn
(i).Location = New Point(10NewLoc)
            
Btn(i).Text i
            Me
.Controls.Add(Btn(i))

        
Next
    End Sub



  
Private Sub Button2_Click(sender As ObjectAs EventArgsHandles Button2.Click
        Btn
(5).Text "hi! here is 5"
        
Btn(7).Text "hi! here is 7"
    
End Sub 

but i got this error when i click on button 1:

"object reference not set to an instance of an object"

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>