Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command Group Value
Message
From
23/01/2002 10:56:12
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00606848
Message ID:
00609031
Views:
28
>Hi David,
>
>Ok, here’s what I’m trying to do. The CLICK event in the cmg has a case statement:
>
>DO CASE
>CASE THIS.VALUE = 1
> * Do thing 1
>CASE THIS.VALUE = 2
> * Do thing 2
>CASE THIS.VALUE = 3
> * Do thing 3
>CASE THIS.VALUE = 4
> * Do thing 4
>ENDCASE
>
>There are other situations in which I want the code associated with the case to execute. These are associated with another form in the form set. I don’t want the second form to be concerned with what happens when the button is clicked, I just want the action to occur.
>
>There are dozens of ways to do this, but I’m interested in finding the most elegant or best in terms of the object model. Being the neophyte that I am, this has become an exercise in understanding the basics. I really appreciate your help!
>
>Rich


Rich,

Why not create a custom method in the form.

mycustommethod
Lparameters thebuttonclicked

DO case
	Case thebuttonclicked="Command1"
		Wait window "You clicked command button 1"
	Case thebuttonclicked="Command2"
		Wait window "You clicked command button 2"
	Case thebuttonclicked="Command3"
		Wait window "You clicked command button 3"
	Case thebuttonclicked="Command4"
		Wait window "You clicked command button 4"
Endcase
Then in the commandgroup.commandbutton(s) click envent do
thisform.mycustommethod(this.Name)
Hope this helps. I did test it.
Previous
Reply
Map
View

Click here to load this message in the networking platform