Date: 02-16-2022
Return to Index
created by gbSnippets
'The TAB order of a control can be set in several ways. The WS_Tabstop style
'or simply the order in which a control is added to a dialog are the usual two
'ways. 'But during execution, the SetWindowPOS and BringWindowToTop can also be used.
'The SetWindowPOS can set TAB order specifically, whereas the BringWindowToTop
'has no option except to bring the window to the top of the zorder.
'Primary Code:
BringWindowToTop GetDlgItem(hDlg,100)
'Compilable Example: (Jose Includes)
'Here, 3 buttons are placed on a control. Pressing a button moves it to the
'top of the zorder (TAB order).
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg as DWord
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Control Add Button, hDlg, 200,"Push", 50,50,100,20
Control Add Button, hDlg, 300,"Push", 50,90,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case CB.Msg
Case %WM_Command
Select Case CB.Ctl
Case 100: BringWindowToTop GetDlgItem(hDlg,100)
Case 200: BringWindowToTop GetDlgItem(hDlg,200)
Case 300: BringWindowToTop GetDlgItem(hDlg,300)
End Select
End Select
End Function
'gbs_00510
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm