Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "win32api.inc"
#Include "commctrl.inc"
Global hDlg, hTAB, hTemp As Dword
%IDC_Tab = 500
Function PBMain() As Long
Dialog New Pixels, 0, "TAB Test",300,300,200,150, %WS_OverlappedWindow Or %WS_ClipChildren, 0 To hDlg
Control Add Tab, hDlg, %IDC_Tab, "", 20,20,150,100
Control Handle hDlg, %IDC_Tab To hTab
Tab Insert Page hDlg, %IDC_Tab, 1, 0, "Tab 3" To hTemp
Tab Insert Page hDlg, %IDC_Tab, 1, 0, "Tab 2" To hTemp
Tab Insert Page hDlg, %IDC_Tab, 1, 0, "Tab 1" To hTemp
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_ContextMenu
Local HT As TC_HitTestInfo, temp$
GetCursorPos HT.pt : ScreenToClient hTab, HT.pt 'tab coordinates of mouse
Dialog Set Text hDlg, "Right mouse on: " + Str$(SendMessage(hTab, %TCM_HitTest, 0, VarPtr(HT)) + 1) 'tab page under mouse at drop
End Select
End Function
'gbs_00805
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm