Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Showing hiding some command buttons
Message
De
11/04/2009 16:49:00
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/04/2009 22:59:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01394306
Message ID:
01394363
Vues:
41
>I have series of buttons in my command group. When clicked, this should bring some other buttons (not contained in a command group).
>
>When command1 in commandgroup is clicked, command1.. command2 should show up and others hidden..
>When command2 in commandgroup is clicked, command3.. command6 should show up and others hidden (command1 and command2)
>
>I'm used to writing in each clicked event.. command3.visible=.f., command4.visible=.f. etc and using SETALL to disable all command buttons then setting the visible property to .T. for all command buttons in the commandgroup.
>
>Any better way to approach this?
>
>I have 8 command buttons in my command group and more than 10 other command buttons..

Commandgroups were someone's idea of a "looked like a good idea at the time". Like Tamar said, they don't bring you any value, other than having a .buttons array (but even that's advantage is gone since now all containers have .objects and/or .controls).

You can group your buttons into containers - which don't have to be visible, can be transparent even when they are, can have .borderwidth=0, and can overlap. So you make one group of buttons in containerA, another in containerB. In Command1 you can simply say
thisform.CommandOneOn=not thisform.CommandOneOn
l=thisform.lockscreen
thisform.lockscreen=.t.
if thisform.CommandOneOn
   with this.parent
      .cntFirstGroupOfButtons.visible=.t.
      .cntSecondGroupOfButtons.visible=.f.
   else
      .cntFirstGroupOfButtons.visible=.f.
      .cntSecondGroupOfButtons.visible=.t.
   endwith
endif
thisform.lockscreen=l

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform