Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

right-click menu

Status
Not open for further replies.

scklifasovskiy

Programmer
Nov 12, 2012
57
CA
hi all,
i have a default right-click menu class(cut,copy,paste).
Now, on one of the forms I execute AddItem to add additional option (Search by)...when u add an item you specify 1-- description 2 -- method to be used... Works wonderfully -- it shows... BUT ... now I want this method to have a parameter (.T./.F.) -- now i have problem -- when I click on my new option my method is executed as was defined (with .F.) -- BUT i need it .F. on initialization but .T. when you actually clicked on this option.

i hope i was clear
 
What is the AddItem method you refered to? As far as I know, the only such method applies to list boxes and combo boxes.

Regarding the parameter, you seem to be saying that you always want it to be .T. If that's so, why do you need a parameter?

Perhaps you could clarify these points, as your question is not 100 percent clear.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
my problem is this: once i added menuitme by additem... ON SELECTION BAR i have objSearch(.F.) ..all i want to say to the ON SELECTION BAR that parameter is .T. now at the point that you click on Search By
 
my question is : where should i put code when ON SELECTION BAR executes ???
 
i need to know what was selected on ON SELECT BAR so i can execute my code with different parameter
 
Well, you don't add a menu item by AddItem. You use DEFINE BAR.

But let's move on. Regarding ON SELECTION BAR. Are you saying that you want to pass a parameter, but you don't know what the parameter will be at the point where you execute ON SELECTION BAR? That's a fairly common situation.

You just need to pass the parameter as a variable, rather than the actual value of .T. or .F. So, create a variable in the usual way. Set its value to whatever you want. And then pass that in the command that goes with ON SELECTION BAR.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top