trepdas Active Member Licensed User Nov 21, 2017 #1 Hi all. I managed to handle sender with tags and control buttons as array. BUT still can't figure out how to do this in b4a : for i = 0 to 9 label(i).visible = false next any help? Sorry for the novice question and Thanks.
Hi all. I managed to handle sender with tags and control buttons as array. BUT still can't figure out how to do this in b4a : for i = 0 to 9 label(i).visible = false next any help? Sorry for the novice question and Thanks.
klaus Expert Licensed User Longtime User Nov 21, 2017 #2 You need to show us more code! Where and how are the Labels and the array of Labels defined? Upvote 0
trepdas Active Member Licensed User Nov 21, 2017 #3 in vb6 I created 9 labels Called it "Sign" . Created the first and then copy pasted it (Vb6 asks if I want to make it an array - I Chose "yes") now, I indexed it with 1-9. so I have : Sign(1), Sign(2), Sign(3) etc.... Now, I want to change Sign(3) Since I can index the labels in VB6 - I would simply code: Sign(3).visible = False how would it be like in B4A ? Upvote 0
in vb6 I created 9 labels Called it "Sign" . Created the first and then copy pasted it (Vb6 asks if I want to make it an array - I Chose "yes") now, I indexed it with 1-9. so I have : Sign(1), Sign(2), Sign(3) etc.... Now, I want to change Sign(3) Since I can index the labels in VB6 - I would simply code: Sign(3).visible = False how would it be like in B4A ?
XbNnX_507 Active Member Licensed User Longtime User Nov 21, 2017 #4 trepdas said: in vb6 I created 9 labels Called it "Sign" . Created the first and then copy pasted it (Vb6 asks if I want to make it an array - I Chose "yes") now, I indexed it with 1-9. so I have : Sign(1), Sign(2), Sign(3) etc.... Now, I want to change Sign(3) Since I can index the labels in VB6 - I would simply code: Sign(3).visible = False how would it be like in B4A ? Click to expand... In order to help you, you need to post the code you used. How you define the array of buttons ? Upvote 0
trepdas said: in vb6 I created 9 labels Called it "Sign" . Created the first and then copy pasted it (Vb6 asks if I want to make it an array - I Chose "yes") now, I indexed it with 1-9. so I have : Sign(1), Sign(2), Sign(3) etc.... Now, I want to change Sign(3) Since I can index the labels in VB6 - I would simply code: Sign(3).visible = False how would it be like in B4A ? Click to expand... In order to help you, you need to post the code you used. How you define the array of buttons ?
trepdas Active Member Licensed User Nov 21, 2017 #5 ok. Labels behave like Buttons... Yes. I am dumb. So I simply do the same with buttons. create a common eventname and then use sender. ok..... Upvote 0
ok. Labels behave like Buttons... Yes. I am dumb. So I simply do the same with buttons. create a common eventname and then use sender. ok.....
XbNnX_507 Active Member Licensed User Longtime User Nov 21, 2017 #6 trepdas said: ok. Labels behave like Buttons... Yes. I am dumb. So I simply do the same with buttons. create a common eventname and then use sender. ok..... Click to expand... yes Upvote 0
trepdas said: ok. Labels behave like Buttons... Yes. I am dumb. So I simply do the same with buttons. create a common eventname and then use sender. ok..... Click to expand... yes
trepdas Active Member Licensed User Nov 23, 2017 #7 .... Let's conclude that with an advice for all of us newbies : Read the attached tutorials. Go through the source code. The basic is there... Upvote 0
.... Let's conclude that with an advice for all of us newbies : Read the attached tutorials. Go through the source code. The basic is there...
M megzz Member Licensed User Longtime User Nov 23, 2017 #8 trepdas said: Hi all. I managed to handle sender with tags and control buttons as array. BUT still can't figure out how to do this in b4a : for i = 0 to 9 label(i).visible = false next any help? Sorry for the novice question and Thanks. Click to expand... append this line in between code B4X: label(i).tag = i simple: B4X: for i = 0 to 9 label(i).visible = false label(i).tag = i next so in click to any lable you can control this for example : B4X: sub label_Click dim lbl as lable lbl = sender dim index as int index = lbl.tag label(index).color = colors.red end sub lable variable should is public Upvote 0
trepdas said: Hi all. I managed to handle sender with tags and control buttons as array. BUT still can't figure out how to do this in b4a : for i = 0 to 9 label(i).visible = false next any help? Sorry for the novice question and Thanks. Click to expand... append this line in between code B4X: label(i).tag = i simple: B4X: for i = 0 to 9 label(i).visible = false label(i).tag = i next so in click to any lable you can control this for example : B4X: sub label_Click dim lbl as lable lbl = sender dim index as int index = lbl.tag label(index).color = colors.red end sub lable variable should is public