Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's a commandgroup
Message
De
03/01/2008 10:48:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
03/01/2008 08:39:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01279201
Message ID:
01279252
Vues:
7
>In pursuing a thread last week about being able to hide pages in a pageframe, I encountered, for the first time, a CommandGroup.
>
>What's the common usage for a CommandGroup, anyway? At first glance, it seems like a container with commandbuttons inside, with the following differences:
>1) It has a value ( 1 to N)
>2) And a controlsource
>3) The "currently selected" commandbutton has its background color sort of dithered out so that you can tell its been selected.
>
>Are there any other differences of note?
>
>Is it possible to disable the change in background for the selected commandbutton? I'd like to use the solution found in "mhtabs" (which uses a commandgroup to replace the tabs on a pageframe), but the places where I use it have tabs of different colors -- and it looks really odd to have the background color change when you click on one the buttons. (For what it's worth, I normally change the forecolor and bold of the selected tab in the pageframe.)
>
>Thanks in advance,
>
>Jim

Jim,
2) I don't think it has a controlsource (or maybe I'm mistaken, never even tried to check if it had one).
3) The "currently selected" commandbutton has its background color sort of dithered out so that you can tell its been selected.

I'm not sure about this one. I haven't seen the effect.

1) It has a value ( 1 to N)
Yes and that is the reason you'd want to use a CommandGroup for a group of buttons. Consider you have a series of buttons that have different captions but should work together as a group. An example would be "Top,Previous,Next,Last" navigation buttons. For these 'group' of buttons you may want to have common code + a single place to code the click code instead of individual click code of each. ie:
* CommandGroup.Click
do case
  case this.Value = 1 && Top
*...
  case this.Value = 2 && Previous
*...
  case this.Value = 3 && Next
*...
  case this.Value = 4 && Last
*...
endcase
Value correspond to buttons' tabindex. If an individual button has code in its click, then that code is executed, else CommandGroup.Click code is executed. This lets you write common click code + override click code per individual button. Having it as a class you could have other common methods for your buttons (ie: EnableDisable, SetCaptions, their layout, ...).

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform