|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Offer Har
|
Oct 17, 2007 - 4:19 PM
|
Dear Support,
I have a dialog application with controls and group-boxes.
I have a control that I create in my code (not in the resource editor). When I place it inside a group-box it flickers. In the FAQ you solve this problem with changing the tab order, but this control does not exist in the resource editor, because it is only created at run time.
Regards, Ron.
|
|
Technical Support
|
Oct 18, 2007 - 1:19 PM
|
You can change the tab order programmatically. Since version 2.80 there is a SubclassChildControls() global function which can be used for subclassing standard controls with Prof-UIS controls. This function also eliminates the problem of a wrong tab order for the controls used in CExtGroupBox . You can fix only the tab order using the following method void FixGroupBoxesOrder( HWND hWndParent )
{
if( hWndParent == NULL
|| (!::IsWindow( hWndParent ))
)
return;
HWND hWnd = ::GetWindow( hWndParent, GW_CHILD );
HWND hWndLast = NULL;
CDWordArray arrGroupBoxes;
while( hWnd != NULL )
{
TCHAR szCompare[512] = _T("");
::GetClassName(
hWnd,
szCompare,
sizeof( szCompare ) / sizeof( szCompare[0] )
);
if( _tcsicmp( szCompare, _T("BUTTON") ) == 0 )
{
#ifdef BS_TYPEMASK
ASSERT( BS_TYPEMASK == 0x0000000FL );
#endif
DWORD dwWndStyle = (DWORD)::GetWindowLong( hWnd, GWL_STYLE );
if( ( dwWndStyle & 0x0000000FL ) == BS_GROUPBOX )
arrGroupBoxes.Add( DWORD( hWnd ) );
}
hWndLast = hWnd;
hWnd = ::GetWindow( hWnd, GW_HWNDNEXT );
}
if( hWndLast != NULL
&& arrGroupBoxes.GetSize() > 0
)
{
// move all the group boxes to the back by changing the tab order at runtime
HWND hWndPrev = hWndLast;
while( arrGroupBoxes.GetSize() > 0 )
{
HWND hWnd = (HWND) arrGroupBoxes.GetAt( 0 );
if( hWnd != NULL
&& ::IsWindow( hWnd )
)
{
::SetWindowPos(
hWnd,
hWndPrev,
0,0,
0,0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE
);
hWndPrev = hWnd;
}
arrGroupBoxes.RemoveAt( 0 );
}
}
}
|
|
Offer Har
|
Oct 18, 2007 - 2:45 PM
|
|
|