|
-
Nov 28th, 2012, 07:18 PM
#1
Thread Starter
Junior Member
vs2010, Button(1) - Button(2500) "Addhandlers" too much for memory, how to reduce?
To explain further, i'm creating lots of buttons and want to be able to have each perform different actions.
R = 1
C = 1
For i as Integer = 1 to 2500
Button(R, C) = New Button
Button(R, C).Parent = Me
...
If C = 50 Then
R += 1
C = 1
Else
C += 1
End If
next
This is creating a grid of buttons from (1,1) to (50,50), and i want each button to change R and C to it's own number, ie
Addhandler Button(30, 48).Click, Addressof R30C48
Private Sub R30C48
R = 30
C = 48
End Sub
etc etc...
I made a seperate bit of software to write it all for me, but when i click one of the buttons it comes up with an error message saying that i'm using too much memory. I can only assume that there is a lesser memory consuming method of doing the same thing but in a much easier way, kind of like the For Loop i used to create the buttons.
Thank you in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|