Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Borland C++ Move Focus (http://www.programmingforums.org/showthread.php?t=4084)

Automatik May 24th, 2005 4:48 PM

Borland C++ Move Focus
 
Lets say I click a button, how would I then programatically shift the focus to a StringGrid Cell or to anything for that matter.

kurifu Jun 12th, 2005 4:27 AM

Control::Focus is the property you are looking for, or maybe it is a method, I do not remember... oh this is assuming that you are using VCL.

grumpy Jun 12th, 2005 5:18 AM

If he's using Borland Builder, he's almost certainly using the VCL. If he's using Borland C++, he may or may not be using the VCL.

First the VCL way: TWinControl, is the base class from which all windowing controls are derived. In rough terms, the definition of a windowing control is one that has three core attributes (it can receive focus, it can contain other controls, and it has a window handle). TWinControl has a method called SetFocus(), which takes no arguments, and makes the control grab focus.

The win32 SDK way requires a handle for the control. Use SendMessage() to send a WM_SETFOCUS message to the control.


All times are GMT -5. The time now is 12:55 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC