Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move focus from toolbar textbox to active form control
Message
From
07/06/2005 16:03:30
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Move focus from toolbar textbox to active form control
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01021089
Message ID:
01021089
Views:
92
Is there anyway to change focus from textbox on a toolbar to the currently active control of the active form?

For example, I have a textbox on a toolbar for searching. When the user hits Enter, I would like to return them to the active control on their active form.

I use KeyPress to detect Enter key, but I can't seem to get focus to leave my toolbar unless I release the toolbar itself.

Here's how I'm trying to return focus back to my active control:
if type( "_Screen.ActiveForm.ActiveControl.Name" ) == "C"
  activate window (_Screen.ActiveForm.Name)
  _Screen.ActiveForm.ActiveControl.SetFocus()
  set message to "Setfocus() to " + _Screen.ActiveForm.ActiveControl.Name
else
  set message to "No activecontrol to set focus to"
endif


Any ideas?

Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Next
Reply
Map
View

Click here to load this message in the networking platform