Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of buttons in the toolbar
Message
From
28/01/2003 15:12:50
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brazil
 
 
To
28/01/2003 15:00:50
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00746392
Message ID:
00746399
Views:
11
Hi Mathew!

>If I have a TBars class as the container class with couple of buttons in
> it. How would I go about counting the number of buttons in that toolbar
>container? And If it's possible to find if the buttons are enabled or
>disabled?

You can try this:
Local lnPosControl, lnButtons, lcMsg
lcMsg = ""
lnButtons = 0
For lnPosControl = 1 To ThisForm.tBars.ControlCount
   If ThisForm.tBars.Controls(lnPosControl).Class = "CommandButton"
      lnButtons = lnButtons + 1  
      lcMsg = lcMsg + Iif(Empty(lcMsg), "", Chr(13)) + ;
          ThisForm.tBars.Controls(lnPosControl).Name + " - " + ;
          Iif(ThisForm.tBars.Controls(lnPosControl).Enabled, ;
              "Enabled", "Disabled")
   Endif
EndFor
Messagebox(AllTrim(Str(lnButtons)) + " buttons")
Bye!
Erick
Força Sempre!
Strength Always!
Previous
Reply
Map
View

Click here to load this message in the networking platform