[SOLVED] Finding each control with same ID |
Post Reply |
Author | |
sforces
Groupie Joined: 13 May 2009 Status: Offline Points: 71 |
Post Options
Thanks(0)
Posted: 07 August 2010 at 3:27pm |
I am using RibbonBar and directly on it I have a checkbox control to "Enable XYZ" and ID_OPTION_ENABLE_XYZ.
I also have a "Options" popup control and a button control there is also "Enable XYZ" and ID_OPTION_ENABLE_XYZ. I thought that if I use same ID (as they are really same) that when I use "FindControl" method, it would toggle the Checked property for both of them. But it only finds one and the other isn't toggled. 1) Is it a bad idea to have same ID? 2) I thought about using a for each loop on the commandbars objects, checking the ID and checked state but I don't think that's very efficient. How do I efficiently find all controls with same ID and toggle them? |
|
Product: Xtreme Suite Pro (ActiveX) version 16.3.1
Platform: Windows XP SP3 (32bit) Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
I think you should be using Actions in this case - check out the Actions sample that comes with the suite.
With actions, you can associate multiple controls with a single action, and then enable/disable an action and all of the associated controls will be enabled/disabled accordingly. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
sforces
Groupie Joined: 13 May 2009 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
Thank you. This is exactly what I was looking for!
|
|
Product: Xtreme Suite Pro (ActiveX) version 16.3.1
Platform: Windows XP SP3 (32bit) Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Glad to help!
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |