Once again about labels

basil99

Active Member
Licensed User
Longtime User
Hi!

read a lot of posts here, but still have no idea how to solve a problem i meet.

So, lets start

1) I have a Panel, a Label, array of Labels and a Button:

Code: Copy
Dim MyPanel As Panel
Dim Title As Label   
Dim Captions( 10, 10 ) As Label  '10 is a sample value
Dim Push as button


2) All labels are inited with text values, colors, etc and added to MyPanel.
When button Push is pressed, i need:

a) change text value for Title Lable
b) make some Captions label visible or invisible, change it color, text etc, depending on some conditions


Code: Copy
sub Push_Click

      ' x and y are Ints previously calculated
     Title.Text = "New Text"
     Captions( x, y ).Visible = False

end sub

By some reason this Title.Text = "New Text" works fine, but all of this
Code: Copy
 Captions( x, y ).Visible = False or true
 Captions( x, y ).Enable = False or true
 Captions( x, y ).Color = Colors.RGB( 0,0,0 )
return "Programm paused" message on my phone

So, what i'm doing wrong ? Any way to manage of this Labels array ?

Thak you
 
try loging the x and y values to see if they are correct and valid...
Remember that you are using a 2 dimension array, so it can be tricky....
 
Upvote 0
Weird. Spent some time formatting and commenting code, then compile again and error gone, so all works fine. Have no idea what was wrong )
 
Upvote 0
Back
Top