D dragonguy Active Member Licensed User Longtime User Mar 20, 2014 #1 I create the button, then need to store some info to the button, i use button text to store button name, button tag to store code1, but i still got 2 code need to tag to button, so how can i make more tag member so i can store all the info. please help me. Thanks!
I create the button, then need to store some info to the button, i use button text to store button name, button tag to store code1, but i still got 2 code need to tag to button, so how can i make more tag member so i can store all the info. please help me. Thanks!
barx Well-Known Member Licensed User Longtime User Mar 20, 2014 #2 Create a custom type that store all the info you want to store and save that to the .tag. Upvote 0
D dragonguy Active Member Licensed User Longtime User Mar 20, 2014 #3 how to create custom type? i'm little confuse. i go search many threads also can't find any related to custom types sample to learn. Please help me. Last edited: Mar 20, 2014 Upvote 0
how to create custom type? i'm little confuse. i go search many threads also can't find any related to custom types sample to learn. Please help me.
DonManfred Expert Licensed User Longtime User Mar 20, 2014 #4 You can simply create a map with all needed data and put this map to the buttons tag. You can have X Infos inside your Tag with this... Code: Copy Dim retmap As Map retmap.Initialize retmap.Put("tag","TagValue"&i) retmap.Put("itemID","ItemID"&i) retmap.Put("name","ItemName"&i) retmap.Put("line1","This is line 1") retmap.Put("line2","This is line 2") buttonX.Tag = retmap Upvote 0
You can simply create a map with all needed data and put this map to the buttons tag. You can have X Infos inside your Tag with this... Code: Copy Dim retmap As Map retmap.Initialize retmap.Put("tag","TagValue"&i) retmap.Put("itemID","ItemID"&i) retmap.Put("name","ItemName"&i) retmap.Put("line1","This is line 1") retmap.Put("line2","This is line 2") buttonX.Tag = retmap
D dragonguy Active Member Licensed User Longtime User Mar 20, 2014 #6 DonManfred said: You can simply create a map with all needed data and put this map to the buttons tag. You can have X Infos inside your Tag with this... Code: Copy Dim retmap As Map retmap.Initialize retmap.Put("tag","TagValue"&i) retmap.Put("itemID","ItemID"&i) retmap.Put("name","ItemName"&i) retmap.Put("line1","This is line 1") retmap.Put("line2","This is line 2") buttonX.Tag = retmap Click to expand... if i got many button, also can use this way? after put all the info to the map, how can i read it? Last edited: Mar 20, 2014 Upvote 0
DonManfred said: You can simply create a map with all needed data and put this map to the buttons tag. You can have X Infos inside your Tag with this... Code: Copy Dim retmap As Map retmap.Initialize retmap.Put("tag","TagValue"&i) retmap.Put("itemID","ItemID"&i) retmap.Put("name","ItemName"&i) retmap.Put("line1","This is line 1") retmap.Put("line2","This is line 2") buttonX.Tag = retmap Click to expand... if i got many button, also can use this way? after put all the info to the map, how can i read it?
DonManfred Expert Licensed User Longtime User Mar 20, 2014 #7 dragonguy said: if i got many button, also can use this way? Click to expand... You must do that for each of your buttons, yes. dragonguy said: after put all the info to the map, how can i read it? Click to expand... Code: Copy Sub Button1_Click Dim retmap As Map retmap.Initialize retmap = Button1.Tag Log(retmap.Get("tag")) Log(retmap.Get("itemID")) Log(retmap.Get("name")) Log(retmap.Get("line1")) Log(retmap.Get("line2")) End Sub Last edited: Mar 20, 2014 Upvote 0
dragonguy said: if i got many button, also can use this way? Click to expand... You must do that for each of your buttons, yes. dragonguy said: after put all the info to the map, how can i read it? Click to expand... Code: Copy Sub Button1_Click Dim retmap As Map retmap.Initialize retmap = Button1.Tag Log(retmap.Get("tag")) Log(retmap.Get("itemID")) Log(retmap.Get("name")) Log(retmap.Get("line1")) Log(retmap.Get("line2")) End Sub
D dragonguy Active Member Licensed User Longtime User Mar 21, 2014 #8 Thanks, already solved my problem!! Upvote 0