Re: How to find the Parent Control of a Context Menu by Joe
Joe
Thu Aug 17 13:32:57 CDT 2006
Well, you could add something like this:
int rep;
CString strQ;
strQ.Format("Convert %s to %s?", txt1.Text, ToUpper(txt1.Text));
rep = MessageBox(strQ, "Confirm Conversion", MB_YESNO | MB_ICONQUESTION);
if (rep == IDYES)
{
txt1.Text = ToUpper(txt1.Text);
}
else
{
strQ = _T("Please select the text box you would like to convert to upper
case.");
MessageBox(strQ, "Conversion Help", MB_OK | MB_ICONINFORMATION);
}
Not as pretty.
Of course, you could also put more event handlers for your CEdit control
into your code, like something to handle the OnChange and OnSetFocus.
Anytime one of these is accessed, update your boolean value.
Otherwise, I'm at a loss as to what to recommend.
"Ron Weiner" wrote:
> I appreciate your help, but what if txt2 has the focus, then the user tap'd
> / held txt1 and choose ToUpper from the context menu. In this scenario txt2
> was the last to have the focus, txt1 NEVER received the focus and now the
> user wants to make txt1 uppercase. Can it really be this hard?