Yashied Posted April 1, 2011 Posted April 1, 2011 Does anyone know how to get rid of it?GUICreate('MyGUI', 300, 300) GUISetBkColor(0xAACCFF) GUICtrlCreateTab(20, 20, 260, 260) GUICtrlCreateTabItem('Item1') GUICtrlCreateTabItem('Item2') GUICtrlCreateTabItem('') GUISetState() Do Until GUIGetMsg() = -3 My UDFs: Reveal hidden contents iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
UEZ Posted April 1, 2011 Posted April 1, 2011 I assume you have to create a label with the same color as the gui background to put on tab. Have a look to OwnTab-UDF from funkey. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Yashied Posted April 1, 2011 Author Posted April 1, 2011 Thanks, but I'm interested in native solution, not a trick. I can not understand where Tab takes the background color. If I write the following _WinAPI_SetClassLongEx($hTab, $GCL_HBRBACKGROUND, _WinAPI_CreateSolidBrush(0xFFCCAA)) still nothing happens... Of course, I can draw your own skin or use a Windows theme, but it is quite time-consuming solution. My UDFs: Reveal hidden contents iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
martin Posted April 1, 2011 Posted April 1, 2011 On 4/1/2011 at 8:02 PM, 'Yashied said: Thanks, but I'm interested in native solution, not a trick. I can not understand where Tab takes the background color. If I write the followingI thgink that the tab control uses the default windows background colour so you could change that I suppose.Having seen the same question asked over the years and seen SmOke_N's attempts (failed) to get round it I am fairly sure you won't find a native solution. That is why Delphi (which I use) has it's own nice tab control which doesn't have all problems the windows one has.One way to avoid the wrong color at the top left is to set the tab widths so they fill the width of the tab control. Placing a label over the offending area works quite well but you have to adjust the position of the label depending on which tab is selected to maintain a neat result. I think the windows tab control is very poor. If you try having tabs at the sides instead of the top you will conclude that the designers were about to leave to start work at Apple. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Yashied Posted April 3, 2011 Author Posted April 3, 2011 While nothing is better not come up. Works under Windows Vista/7.expandcollapse popup#Include <Constants.au3> #Include <GUITab.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global Const $STM_GETIMAGE = 0x0173 Global Const $PRF_CLIENT = 0x04 Global $hPic, $hTab, $hDll, $pDll, $hProc GUICreate('MyGUI', 300, 300) GUICtrlCreatePic(@ScriptDir & '\Tech.bmp', 0, 0, 300, 300, $WS_CLIPCHILDREN) $hPic = GUICtrlGetHandle(-1) GUICtrlCreateTab(20, 20, 262, 261, $TCS_FOCUSONBUTTONDOWN) $hTab = GUICtrlGetHandle(-1) GUICtrlCreateTabItem('Tab 1') GUICtrlCreateTabItem('Tab 2') GUICtrlCreateTabItem('Tab 3') GUICtrlCreateTabItem('') $hDll = DllCallbackRegister('_WinProc', 'ptr', 'hwnd;uint;wparam;lparam') $pDll = DllCallbackGetPtr($hDll) $hProc = _WinAPI_SetWindowLongEx($hTab, $GWL_WNDPROC, $pDll) _WinAPI_SetParent($hTab, $hPic) OnAutoItExitRegister('AutoItExit') GUISetState() Do Until GUIGetMsg() = -3 Func _CreateClipRgn($hWnd) Local $tRect Local $Count = _GUICtrlTab_GetItemCount($hWnd) Local $Sel = _GUICtrlTab_GetCurSel($hWnd) Local $hRgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) Local $hTmp, $Ht For $i = 0 To $Count - 1 $tRect = _GUICtrlTab_GetItemRectEx($hWnd, $i) If $i = $Sel Then $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1) - 2, DllStructGetData($tRect, 2) - 2, DllStructGetData($tRect, 3) + 2, DllStructGetData($tRect, 4)) $Ht = DllStructGetData($tRect, 4) - DllStructGetData($tRect, 2) + 2 Else If $i = $Count - 1 Then $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1), DllStructGetData($tRect, 2), DllStructGetData($tRect, 3) - 2, DllStructGetData($tRect, 4)) Else $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1), DllStructGetData($tRect, 2), DllStructGetData($tRect, 3), DllStructGetData($tRect, 4)) EndIf EndIf _WinAPI_CombineRgn($hRgn, $hRgn, $hTmp, $RGN_OR) _WinAPI_DeleteObject($hTmp) Next $tRect = _WinAPI_GetClientRect($hWnd) $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1), DllStructGetData($tRect, 2) + $Ht, DllStructGetData($tRect, 3) - 2, DllStructGetData($tRect, 4) - 1) _WinAPI_CombineRgn($hRgn, $hRgn, $hTmp, $RGN_OR) _WinAPI_DeleteObject($hTmp) Return $hRgn EndFunc ;==>_CreateClipRgn Func _WinProc($hWnd, $iMsg, $wParam, $lParam) If _WinAPI_IsThemeActive() Then Switch $iMsg Case $WM_ERASEBKGND Local $tRect[2] Local $hParent = _WinAPI_GetParent($hWnd) Local $hRgn = _CreateClipRgn($hWnd) Local $hPrev = _WinAPI_GetClipRgn($wParam) $tRect[0] = _WinAPI_GetWindowRect($hParent) $tRect[1] = _WinAPI_GetWindowRect($hWnd) _WinAPI_ExtSelectClipRgn($wParam, $hRgn, $RGN_DIFF) _WinAPI_DrawBitmap($wParam, DllStructGetData($tRect[0], 1) - DllStructGetData($tRect[1], 1), DllStructGetData($tRect[0], 2) - DllStructGetData($tRect[1], 2), _SendMessage($hParent, $STM_GETIMAGE)) _WinAPI_SelectClipRgn($wParam, $hPrev) _WinAPI_DeleteObject($hRgn) Return 1 Case $WM_PAINT Local $tPaint Local $hDC = _WinAPI_BeginPaint($hWnd, $tPaint) Local $hRgn = _CreateClipRgn($hWnd) _WinAPI_ExtSelectClipRgn($hDC, $hRgn, $RGN_AND) _WinAPI_CallWindowProc($hProc, $hWnd, $WM_PRINTCLIENT, $hDC, $PRF_CLIENT) _WinAPI_DeleteObject($hRgn) _WinAPI_EndPaint($hWnd, $tPaint) Return 0 EndSwitch EndIf Return _WinAPI_CallWindowProc($hProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_WinProc Func AutoItExit() _WinAPI_SetWindowLongEx($hTab, $GWL_WNDPROC, $hProc) DllCallbackFree($hDll) EndFunc ;==>AutoItExitTech.bmp My UDFs: Reveal hidden contents iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
UEZ Posted April 3, 2011 Posted April 3, 2011 Nice solution / workaround Yashied! Instead using a bitmap you can create a bitmap with same color as the background. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Yashied Posted April 3, 2011 Author Posted April 3, 2011 Without bitmap. expandcollapse popup#Include <Constants.au3> #Include <GUITab.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global Const $PRF_CLIENT = 0x04 Global $hTab, $hDll, $pDll, $hProc GUICreate('MyGUI', 300, 300) GUISetBkColor(0xAACCFF) GUICtrlCreateTab(20, 20, 262, 261, $TCS_FOCUSONBUTTONDOWN) $hTab = GUICtrlGetHandle(-1) GUICtrlCreateTabItem('Tab 1') GUICtrlCreateTabItem('Tab 2') GUICtrlCreateTabItem('Tab 3') GUICtrlCreateTabItem('') $hDll = DllCallbackRegister('_WinProc', 'ptr', 'hwnd;uint;wparam;lparam') $pDll = DllCallbackGetPtr($hDll) $hProc = _WinAPI_SetWindowLongEx($hTab, $GWL_WNDPROC, $pDll) OnAutoItExitRegister('AutoItExit') GUISetState() Do Until GUIGetMsg() = -3 Func _CreateClipRgn($hWnd) Local $tRect Local $Count = _GUICtrlTab_GetItemCount($hWnd) Local $Sel = _GUICtrlTab_GetCurSel($hWnd) Local $hRgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) Local $hTmp, $Ht For $i = 0 To $Count - 1 $tRect = _GUICtrlTab_GetItemRectEx($hWnd, $i) If $i = $Sel Then $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1) - 2, DllStructGetData($tRect, 2) - 2, DllStructGetData($tRect, 3) + 2, DllStructGetData($tRect, 4)) $Ht = DllStructGetData($tRect, 4) - DllStructGetData($tRect, 2) + 2 Else If $i = $Count - 1 Then $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1), DllStructGetData($tRect, 2), DllStructGetData($tRect, 3) - 2, DllStructGetData($tRect, 4)) Else $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1), DllStructGetData($tRect, 2), DllStructGetData($tRect, 3), DllStructGetData($tRect, 4)) EndIf EndIf _WinAPI_CombineRgn($hRgn, $hRgn, $hTmp, $RGN_OR) _WinAPI_DeleteObject($hTmp) Next $tRect = _WinAPI_GetClientRect($hWnd) $hTmp = _WinAPI_CreateRectRgn(DllStructGetData($tRect, 1), DllStructGetData($tRect, 2) + $Ht, DllStructGetData($tRect, 3) - 2, DllStructGetData($tRect, 4) - 1) _WinAPI_CombineRgn($hRgn, $hRgn, $hTmp, $RGN_OR) _WinAPI_DeleteObject($hTmp) Return $hRgn EndFunc ;==>_CreateClipRgn Func _WinProc($hWnd, $iMsg, $wParam, $lParam) If _WinAPI_IsThemeActive() Then Switch $iMsg Case $WM_ERASEBKGND Local $hRgn = _CreateClipRgn($hWnd) Local $hPrev = _WinAPI_GetClipRgn($wParam) Local $hBrush = _WinAPI_CreateSolidBrush(0xFFCCAA) Local $tRect = _WinAPI_GetClientRect($hWnd) _WinAPI_ExtSelectClipRgn($wParam, $hRgn, $RGN_DIFF) _WinAPI_FillRect($wParam, DllStructGetPtr($tRect), $hBrush) _WinAPI_SelectClipRgn($wParam, $hPrev) _WinAPI_DeleteObject($hBrush) _WinAPI_DeleteObject($hRgn) Return 1 Case $WM_PAINT Local $tPaint Local $hDC = _WinAPI_BeginPaint($hWnd, $tPaint) Local $hRgn = _CreateClipRgn($hWnd) _WinAPI_ExtSelectClipRgn($hDC, $hRgn, $RGN_AND) _WinAPI_CallWindowProc($hProc, $hWnd, $WM_PRINTCLIENT, $hDC, $PRF_CLIENT) _WinAPI_DeleteObject($hRgn) _WinAPI_EndPaint($hWnd, $tPaint) Return 0 EndSwitch EndIf Return _WinAPI_CallWindowProc($hProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_WinProc Func AutoItExit() _WinAPI_SetWindowLongEx($hTab, $GWL_WNDPROC, $hProc) DllCallbackFree($hDll) EndFunc ;==>AutoItExit My UDFs: Reveal hidden contents iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
UEZ Posted April 3, 2011 Posted April 3, 2011 I need these includes#include <Constants.au3> #include <GuiTab.au3> #include <TabConstants.au3> #include <WinAPIEx.au3> #include <WindowsConstants.au3>and have to add Local Const $WM_PRINTCLIENT = 0x0318 to _WinProc() functions!Nice, nice, nice!Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Yashied Posted April 3, 2011 Author Posted April 3, 2011 On 4/3/2011 at 3:13 PM, 'UEZ said: I need these includesYou have an old version WinAPIEx. My UDFs: Reveal hidden contents iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
martin Posted April 3, 2011 Posted April 3, 2011 It's brilliant Yashied. I like it a lot Since a solution to this has been asked so often I think you should put it in example scripts. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
taietel Posted April 3, 2011 Posted April 3, 2011 Wonderful. Thanks Yashied (also for this)! As Martin said you should put it in example scripts. Things you should know first...In the beginning there was only ONE! And zero... Progs: Reveal hidden contents Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text
Yashied Posted April 3, 2011 Author Posted April 3, 2011 (edited) Unfortunately, in XP will need to create a slightly different clip region (rounded corners). Also, it may depend on the used Windows theme. Edited April 3, 2011 by Yashied My UDFs: Reveal hidden contents iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
AdmiralAlkex Posted April 5, 2011 Posted April 5, 2011 On 4/3/2011 at 11:16 PM, 'Yashied said: Unfortunately, in XP will need to create a slightly different clip region (rounded corners). Also, it may depend on the used Windows theme.You mean that one pixel in the corner? I would think the 1 pixel wide space between tabs is worse.Also when you disable theming the color overflow the tab.Screenshots .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
LeviStevens Posted July 11, 2013 Posted July 11, 2013 I do not have the WinAPIEx.au3 in my install. Where can I find this to use this example? Trying to over come this issue where I am using custom colors and I don't want the default grey theme. I've tried painting a colored label, but then the tabs (button style) aren't visible until you click on them (example, below). GUICtrlCreateLabel("", 0, 120, 751, 320) GUICtrlSetBkColor(-1, $iContentArea) GUICtrlSetState(-1, $GUI_DISABLE)
LeviStevens Posted July 12, 2013 Posted July 12, 2013 Maybe someone could figure out how to implement this API in a UDF to accomplish the colors? http://support.microsoft.com/kb/179909
Moderators Melba23 Posted July 12, 2013 Moderators Posted July 12, 2013 LeviStevens,The WinAPIEx UDF is included with the 3.3.9.x Beta installs. I suggest you download one of them. But I use something like this to produce coloured tabs: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTab.au3> #include <StaticConstants.au3> ; Tab colours Global $aTabColours[4] = [0xFFC0C0, 0xC0FFC0, 0xC0C0FF, 0xC0C0C0] ; Create GUI Global $hGUI = GUICreate ("Test", 400,300) GUISetBkColor (0) ; Create label to cover tab "tab" Global $hColourTab = GUICtrlCreateLabel("", 0, 0, 1, 1, BitOR($SS_NOTIFY, $SS_CENTER, $SS_SUNKEN)) ; Create tab Global $hTab = GUICtrlCreateTab(5, 5,390, 290) Global $hTab_Handle = GUICtrlGetHandle($hTab) ; Create tab items and colour them For $i = 0 To 3 GUICtrlCreateTabItem ("Tab item - " & $i) _GUICtrlTab_SetBkColor($hGUI, $hTab, $aTabColours[$i]) GUICtrlCreateTabItem ("") Next _GUICtrlTab_SetCurSel($hTab_Handle,0) _GUICtrlTab_SetCurFocus($hTab_Handle,0) TabEvent() GUISetState () While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE Exit Case $hTab TabEvent() EndSwitch WEnd Func TabEvent() ; Set values Local $iTab_X = 5, $iTab_Y = 5, $iTab_Margin = 1 ; Get index of current tab Local $iTab_Index = GUICtrlRead($hTab) ; Get coordinates of TabItem Local $aTab_Coord = _GUICtrlTab_GetItemRect($hTab_Handle, $iTab_Index) ; Get text of TabItem Local $sTab_Text = _GUICtrlTab_GetItemText($hTab_Handle, $iTab_Index) ; Place label GUICtrlSetPos($hColourTab, $iTab_X + $aTab_Coord[0] + $iTab_Margin, $iTab_Y + $aTab_Coord[1] + $iTab_Margin, $aTab_Coord[2] - $aTab_Coord[0] - ($iTab_Margin * 2), $aTab_Coord[3] - $aTab_Coord[1] - ($iTab_Margin * 2) + 5) ; Set text GUICtrlSetData($hColourTab, $sTab_Text) ; Set colour GUICtrlsetBkColor ($hColourTab,$aTabColours[$iTab_Index] ) ; Set focus _GUICtrlTab_SetCurFocus($hTab_Handle,$iTab_Index) EndFunc Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor) ; Get tab position Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32) ; Get size of user area Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1) ; Create label GUICtrlCreateLabel("", $aTabPos[0] + 2, $aTabPos[1] + $aTab_Rect[3] + 4, $aTabPos[2] - 6, $aTabPos[3] - $aTab_Rect[3] - 7) ; Colour label GUICtrlSetBkColor(-1, $sBkColor) ; Disable label GUICtrlSetState(-1, $GUI_DISABLE) EndFunc ;==>_GUICtrlTab_SetBkColorAny use? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JakeJohnson74 Posted April 2, 2015 Posted April 2, 2015 When I run this, it does not repaint the controls I place inside of the tab control. For example a listview, the columns are not visible - once I mouse over them they are painted. What can I do to make this behave normally?
Moderators Melba23 Posted April 2, 2015 Moderators Posted April 2, 2015 (edited) JakeJohnson74,Works fine for me: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTab.au3> #include <StaticConstants.au3> ; Tab colours Global $aTabColours[4] = [0xFFC0C0, 0xC0FFC0, 0xC0C0FF, 0xC0C0C0] ; Create GUI Global $hGUI = GUICreate ("Test", 500, 500) ; Create label to cover tab "tab" Global $hColourTab = GUICtrlCreateLabel("", 0, 0, 1, 1, BitOR($SS_NOTIFY, $SS_CENTER, $SS_SUNKEN)) ; Create tab Global $hTab = GUICtrlCreateTab(10, 10, 400, 300) Global $hTab_Handle = GUICtrlGetHandle($hTab) ; Create tab items and colour them For $i = 0 To 3 GUICtrlCreateTabItem ("Tab item - " & $i) _GUICtrlTab_SetBkColor($hGUI, $hTab, $aTabColours[$i]) ; Are you creating the coloured background first? <<<<<<<<<<<<<<<<<<< GUICtrlCreateButton("Button " & $i, 50 + (80 * $i), 50, 80, 30) GUICtrlCreateListView("Col " & $i, 50, 100, 200, 100) GUICtrlCreateTabItem ("") Next _GUICtrlTab_SetCurSel($hTab_Handle,0) _GUICtrlTab_SetCurFocus($hTab_Handle,0) TabEvent() GUISetState () While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE Exit Case $hTab TabEvent() EndSwitch WEnd Func TabEvent() ; Set values Local $iTab_X = 10, $iTab_Y = 10, $iTab_Margin = 1 ; Get index of current tab Local $iTab_Index = GUICtrlRead($hTab) ; Get coordinates of TabItem Local $aTab_Coord = _GUICtrlTab_GetItemRect($hTab_Handle, $iTab_Index) ; Get text of TabItem Local $sTab_Text = _GUICtrlTab_GetItemText($hTab_Handle, $iTab_Index) ; Place label GUICtrlSetPos($hColourTab, $iTab_X + $aTab_Coord[0] + $iTab_Margin, $iTab_Y + $aTab_Coord[1] + $iTab_Margin, $aTab_Coord[2] - $aTab_Coord[0] - ($iTab_Margin * 2), $aTab_Coord[3] - $aTab_Coord[1] - ($iTab_Margin * 2) + 5) ; Set text GUICtrlSetData($hColourTab, $sTab_Text) ; Set colour GUICtrlsetBkColor ($hColourTab,$aTabColours[$iTab_Index] ) ; Set focus _GUICtrlTab_SetCurFocus($hTab_Handle,$iTab_Index) EndFunc Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor) ; Get tab position Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32) ; Get size of user area Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1) ; Create label GUICtrlCreateLabel("", $aTabPos[0] + 2, $aTabPos[1] + $aTab_Rect[3] + 4, $aTabPos[2] - 6, $aTabPos[3] - $aTab_Rect[3] - 7) ; Colour label GUICtrlSetBkColor(-1, $sBkColor) ; Disable label GUICtrlSetState(-1, $GUI_DISABLE) EndFunc ;==>_GUICtrlTab_SetBkColorM23 Edited April 2, 2015 by Melba23 Wrong button too soon! Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JakeJohnson74 Posted April 2, 2015 Posted April 2, 2015 (edited) @Melba Haha it would probably help if I referenced the code I was talking about! haha Sorry It was Yashied's example. Yours does, in fact, work fine. Actually... I think I might just use that instead! It will just take a little cannibalizing because I only need just the area to the right of the tabs. Edited April 2, 2015 by JakeJohnson74
Moderators Melba23 Posted April 2, 2015 Moderators Posted April 2, 2015 JakeJohnson74,No probs. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now