Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which Method has called myMethod?
Message
From
17/02/2006 03:59:36
 
 
To
16/02/2006 17:20:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01096805
Message ID:
01096989
Views:
16
>thisform.ActiveControl

Yes it Worked!!!
Now I tell the whole story.
I wanted to create a ToolBar and Add CommandButtons on it at Runtime. But I could not Add the CommandButtons.Click Methods' code at Runtime.
Then I used BindEvent() for these CommandButtons.
oToolBar.ADDOBJECT('&cObjName','CommandButton')
BindEvent(&cObjName, "Click", oToolBar, "myClick", 2)

Now I used thisform.ActiveControl to Check which CommandButton of oToolBar was clicked.
m.loActiveControl = this.activecontrol && in myClick
do case
case m.loActiveControl.name = 'CmdButton1'
do ...
case m.loActiveControl.name = 'CmdButton2'
do ...
endcase

If BindEvent could pass parameters suppose
BindEvent(&cObjName, "Click", oToolBar, "myClick('&cObjName')", 2)
I wouldn't need thisform.ActiveControl.
.
The Task was to Create a ToolBar According to Users Rights.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform