[ACXFAQ022]
Visual Studio C++: SetFocus() method not working!


The Microsoft MFC framwork has problems focusing our control when using the SetFocus method on our control.  The workaround is to call the SetFocus global function, and pass our component handle.

Visual C++ Example

//Add To top of your file
#include "windows.h"

//Call SetFocus to set the focus on our control
::SetFocus((HWND)m_iSliderX1.GetComponentHandle());


Copyright ©1998-2007 Iocomp Software Incorporated. Iocomp and the Iocomp Logo are registered trademarks of Iocomp Software Inc. All other trademarks are registered by their respective owners.