Jump to content

Changing color of tab area


Recommended Posts

If you run the code below which is an example I found in the helpfile you'll notice there is a rectangle shaped area extending horizontally along the top of the tab. It's a blank brownish space where another tab item would go.

My question is how to change this to match the background color of the window.

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $msg
    
    GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    $tab = GUICtrlCreateTab(10, 10, 200, 100)

    $tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
    $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlSetState(-1, $GUI_SHOW); will be display first
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

    GUICtrlCreateTabItem(""); end tabitem definition

    GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        If $msg = $tab Then
            ; display the clicked tab
            WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
        EndIf
    WEnd
EndFunc   ;==>Example
Link to comment
Share on other sites

I think you're trying to 'change the tab header color" as some call it.

It's not a easy thing to do, but here's the functionality you can try and port from VB-

http://www.vbcity.com/forums/topic.asp?tid...&#RID504942

also these might be usefull-

http://blogs.vbcity.com/canoz/archive/2008/04/05/9014.aspx

http://blogs.vbcity.com/xtab/archive/2008/01/14/8945.aspx

Link to comment
Share on other sites

There is a few workarounds, one is create the tabs justified:

.....
    GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered
    
    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)
    
    $tab = GUICtrlCreateTab(10, 10, 200, 100, $GUI_SS_DEFAULT_TAB+$TCS_FIXEDWIDTH)
    GUICtrlSendMsg($tab, $TCM_SETITEMSIZE, 0, BitAND(65, 0xFFFF) + BitShift(BitAND(15, 0xFFFF), -16))
....

P.S

Needs the #include <TabConstants.au3>.

Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Or you just draw some label with color on the area that you need to cover:

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $msg
    
    GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered
    
    GUISetBkColor(0x00E0FFFF)
    ;GUISetFont(9, 300)
    
    $tab = GUICtrlCreateTab(10, 10, 200, 100)
    
    $tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
    $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlSetState(-1, $GUI_SHOW); will be display first
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

    GUICtrlCreateTabItem(""); end tabitem definition
    
    GUICtrlCreateLabel("", 147, 10, 200, 20)
    GUICtrlSetBkColor(-1, 0x00E0FFFF)
    
    GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)

    GUISetState()
    
    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        If $msg = $tab Then
            ; display the clicked tab
            WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
        EndIf
    WEnd
EndFunc   ;==>Example

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

And here is an example with UDF usage:

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <GUITab.au3>

$hGUI = GUICreate("_GUICtrlTab_CoverBackground - Demo!", 250, 150); will create a dialog box that when displayed is centered
GUISetBkColor(0x00E0FFFF)

$MainTab = GUICtrlCreateTab(10, 10, 230, 120)

$TabItem1 = GUICtrlCreateTabItem("Tab1")
$TabItem2 = GUICtrlCreateTabItem("Tab2")
$TabItem3 = GUICtrlCreateTabItem("Tab3")

GUICtrlCreateTabItem(""); End tabitem definition

$Status_Label = GUICtrlCreateLabel("Current Tab: 1", 20, 130, 250, 20)

_GUICtrlTab_CoverBackground($hGUI, $MainTab, 0x00E0FFFF)

GUISetState()

While 1
    $nMsg = GUIGetMsg()
    
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $MainTab
            GUICtrlSetData($Status_Label, "Current Tab: " & GUICtrlRead($MainTab)+1)
    EndSwitch
WEnd

Func _GUICtrlTab_CoverBackground($hWnd, $hTab, $nColor)
    If Not IsHWnd($hTab) Then $hTab = GUICtrlGetHandle($hTab)
    
    Local $iLastIndex = _GUICtrlTab_GetItemCount($hTab)
    Local $tRect = _GUICtrlTab_GetItemRectEx($hTab, $iLastIndex-1)
    
    Local $aTabPos = ControlGetPos($hWnd, "", $hTab)
    
    Local $iLeft = DllStructGetData($tRect, "Right")
    Local $iBottom = DllStructGetData($tRect, "Bottom")
    
    GUICtrlCreateLabel("", $iLeft + $aTabPos[0] + 2, $aTabPos[1], $aTabPos[2]-$iLeft-2, $iBottom)
    GUICtrlSetBkColor(-1, $nColor)
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

it didn't change the header color.

It's not supose to ;)

Check my last post to see the solution.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

So is label the only way to do it?

I guess that any static control will do (Graphic for example) ;)

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

So is label the only way to do it?

This is the solution I suggested to you when you asked about the same thing a few months ago. Can you look at the result and tell me if it's what you want?

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$LastTheme = XPStyle()
$Tab1 = GUICtrlCreateTab(184, 88, 289, 193)
XPStyle($LastTheme)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$Button3 = GUICtrlCreateButton("Button3", 280, 176, 75, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$Button2 = GUICtrlCreateButton("Button2", 280, 176, 75, 25, 0)
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
$Button1 = GUICtrlCreateButton("Button1", 280, 176, 75, 25, 0)
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd




;XPStyle turns XP theme on or off
;Param $theme - 0 turns XP theme off
;              if an array then the theme is set using the array
;Returns        an array defining the last XP theme
Func XPStyle($theme = 0)
    If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0
    
    If $theme = 0 Or Not IsArray($theme) Then
       $theme = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return $theme
    ElseIf IsArray($theme) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $theme[0])
        Return $theme
    EndIf
    Return 0
EndFunc
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.
Link to comment
Share on other sites

martin:

you still dont understand what im after.

check this code out.

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
GUISetBkColor(0xFFFFFF, $Form1)
$LastTheme = XPStyle()
$Tab1 = GUICtrlCreateTab(184, 88, 289, 193)
XPStyle($LastTheme)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$Button3 = GUICtrlCreateButton("Button3", 280, 176, 75, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$Button2 = GUICtrlCreateButton("Button2", 280, 176, 75, 25, 0)
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
$Button1 = GUICtrlCreateButton("Button1", 280, 176, 75, 25, 0)
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd




;XPStyle turns XP theme on or off
;Param $theme - 0 turns XP theme off
;               if an array then the theme is set using the array
;Returns        an array defining the last XP theme
Func XPStyle($theme = 0)
    If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0
    
    If $theme = 0 Or Not IsArray($theme) Then
       $theme = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return $theme
    ElseIf IsArray($theme) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $theme[0])
        Return $theme
    EndIf
    Return 0
EndFunc

since the bk color is white now you can see the brown tab header color, which i dont want. i dont know what the point of turning off and on the xp themes were.

Edited by IWantIt
Link to comment
Share on other sites

@martin

The problem is in the tab header area, we can not change the background color there (in correct way).

Just add GUISetBkColor(0x0) after GuiCreate() line, and you will see the problem...

Here is a screenshot:

Posted Image

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

martin:

you still dont understand what im after.

check this code out.

.

.

.

since the bk color is white now you can see the brown tab header color, which i dont want. i dont know what the point of turning off and on the xp themes were.

I am a bit lost with your statements.

There is no brown line anymore when I run that code and that was the point of turning off XP themes.

If you mean you don't want the area at the top right to be a different colour to the background then MrCreatoR has already given you more than one solution to that.

Like this for example

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
GUISetBkColor(0xFFFFFF, $Form1)
$LastTheme = XPStyle()
$Tab1 = GUICtrlCreateTab(184, 88, 289, 193)
XPStyle($LastTheme)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$Button3 = GUICtrlCreateButton("Button3", 280, 176, 75, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$Button2 = GUICtrlCreateButton("Button2", 280, 176, 75, 25, 0)
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
$Button1 = GUICtrlCreateButton("Button1", 280, 176, 75, 25, 0)
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateTabItem("")
guictrlcreatelabel("",380,88,100,21)
GUICtrlSetBkColor(-1,0xffffff)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd




;XPStyle turns XP theme on or off
;Param $theme - 0 turns XP theme off
;              if an array then the theme is set using the array
;Returns        an array defining the last XP theme
Func XPStyle($theme = 0)
    If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0
    
    If $theme = 0 Or Not IsArray($theme) Then
       $theme = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return $theme
    ElseIf IsArray($theme) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $theme[0])
        Return $theme
    EndIf
    Return 0
EndFunc
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.
Link to comment
Share on other sites

ok.....

i just wish there was a better way. even using the labels if the first or second tab item is selected the little "brown stuff" still shows a little bit.

I don't know what the "brown stuff" is, but if you mean that the label needs to be moved depending on the tab selected then I agree. There is also a small border around certain tabs and it is difficult to get rid of that.
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.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...