Sign in to follow this  
Followers 0
dany

[SOLVED] Buttons placed behind Tab item

9 posts in this topic

#1 ·  Posted (edited)

The script below demonstrates my problem. If I run this script all icon buttons save the one created before the tab control are placed behind the tab and only the icon shows. I've tried everything I could think of, setting different styles, states etc. to the GUI, tab, button, icon... Well you get the picture. Nothing has worked thusfar and I'm at a complete loss here. Any help would be much appreciated.

This will create a GUI with two tabs and four buttons of which three are behind the tab control.

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

Local $iExit, $iGUIMsg

GUICreate('Problem...', 180, 150, -1, -1, $GUI_SS_DEFAULT_GUI, $WS_EX_TOPMOST)
; This button will show correctly.
$iExit = _IconOnButton('Close', 10, 120, 160, 20, 200)
; Create tab.
GUICtrlCreateTab(5, 5, 120, 140)
; First item and button with missing text and borders.
GUICtrlCreateTabItem('One')
_IconOnButton('First', 10, 30, 160, 20, 3)
; Second item and button with missing text and borders.
GUICtrlCreateTabItem('Two')
_IconOnButton('Second', 10, 60, 160, 20, 24)
; Close tab control.
GUICtrlCreateTabItem('')
; Another button with missing text and borders.
_IconOnButton('Third', 10, 90, 160, 20, 1001)

GUISetState(@SW_SHOW)
While 1
    $iGUIMsg = GUIGetMsg()
    Switch $iGUIMsg
        Case $iExit, $GUI_EVENT_CLOSE ; Exit
            Exit
    EndSwitch
WEnd

; By Valuater
Func _IconOnButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = 'shell32.dll')
    GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16)
    GUICtrlSetState( -1, $GUI_DISABLE)
    Local $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS)
    Return $XS_btnx
EndFunc
Edited by dany

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites



It's because of your $WS_CLIPSIBLINGS style for buttons.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Thanks for the reply. But I wish it was that easy...

Take out $WS_CLIPSIBLINGS and the buttons don't have icons. Not what I want. Reverse the order of the creation in _IconOnButton (button first, then the icon) and the icons do show but disappear as soon as the button's clicked.


[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites

Why don't you use $BS_ICON style for buttons and set the icon directly to button?


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Afaik that doesn't allow for buttons with text, only icon buttons. Those do work btw...


[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites

dany,

This works for me: :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiImageList.au3>
#include <GuiButton.au3>

GUICreate('Problem...', 180, 150, -1, -1, $GUI_SS_DEFAULT_GUI, $WS_EX_TOPMOST)
$iExit = _IconOnButton('Close', 10, 120, 160, 20, 200)
; Create tab.
GUICtrlCreateTab(5, 5, 120, 110)
GUICtrlCreateTabItem('One')
_IconOnButton('First', 10, 30, 100, 20, 3)
GUICtrlCreateTabItem('Two')
_IconOnButton('Second', 10, 60, 100, 20, 24)
; Close tab control.
GUICtrlCreateTabItem('')
_IconOnButton('Third', 10, 90, 160, 20, 1001)

GUISetState(@SW_SHOW)
While 1
    $iGUIMsg = GUIGetMsg()
    Switch $iGUIMsg
        Case $iExit, $GUI_EVENT_CLOSE ; Exit
            Exit
    EndSwitch
WEnd

Func _IconOnButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = 'shell32.dll')

    $cButton = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight)
    $hImageList = _GUIImageList_Create(32, 32, 5, 3)
    _GUIImageList_AddIcon($hImageList, $BIDLL, $BIconNum, True)
    _GUICtrlButton_SetImageList($cButton, $hImageList)
    Return $cButton

EndFunc

The icon indices seem a little off - but I leave finding the correct ones to you. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

Something like this?

#include 
#include 
#include 
#include 
#include 

Local $iExit, $iGUIMsg

GUICreate('No Problem...', 180, 150, -1, -1, $GUI_SS_DEFAULT_GUI, $WS_EX_TOPMOST)

Global $iExit = GUICtrlCreateButton('Close', 10, 120, 160, 20)
_GUICtrlButton_SetImageList(-1, _GetImageListHandle("shell32.dll", -200, False))

; Create tab.
GUICtrlCreateTab(5, 5, 120, 140)
GUICtrlCreateTabItem('One')

GUICtrlCreateButton('First', 10, 30, 160, 20)
_GUICtrlButton_SetImageList(-1, _GetImageListHandle("shell32.dll", -3, False))

GUICtrlCreateTabItem('Two')
GUICtrlCreateButton('Second', 10, 60, 160, 20)
_GUICtrlButton_SetImageList(-1, _GetImageListHandle("shell32.dll", -24, False))

GUICtrlCreateTabItem('') ; Close tab control.


GUICtrlCreateButton('Third', 10, 90, 160, 20)
_GUICtrlButton_SetImageList(-1, _GetImageListHandle("shell32.dll", -1001, False))

GUISetState(@SW_SHOW)
While 1
    $iGUIMsg = GUIGetMsg()
    Switch $iGUIMsg
        Case $iExit, $GUI_EVENT_CLOSE ; Exit
            Exit
    EndSwitch
WEnd

; using image list to set 1 image and have text on button
Func _GetImageListHandle($sFile, $nIconID = 0, $fLarge = False)
    Local $iSize = 16
    If $fLarge Then $iSize = 32

    Local $hImage = _GUIImageList_Create($iSize, $iSize, 5, 3)
    If StringUpper(StringMid($sFile, StringLen($sFile) - 2)) = "BMP" Then
        _GUIImageList_AddBitmap($hImage, $sFile)
    Else
        _GUIImageList_AddIcon($hImage, $sFile, $nIconID, $fLarge)
    EndIf
    Return $hImage
EndFunc   ;==>_GetImageListHandle

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

funkey,

Great minds, eh? :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

AWESOME

Much appreciated, gentlemen. Funkey, your #includes are missing, but I get the point. I definetely need to read up on the standard lib.

Again, Thanks!

Edited by dany

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • wakillon
      FavIcons Screensaver
      By wakillon
      A little animated Screensaver based on FavIcons
    • Hanesis
      Simple click on button
      By Hanesis
      Hi,
      I cant find my mistake in simple task. I Just want to click a button and enter some text in textbox.
      Could you check this out?
      #include <Constants.au3> WinWaitActive("[CLASS:NOTES]") ; this works Send("^m") ; this works ControlSetText("NOTES", "", "[CLASS:IRIS.tedit; INSTANCE:1])", "Some email adress.....") ;this should write an email adress ControlClick("NOTES", "", "[ID:1610760201]") ;this should press the button send https://onedrive.live.com/embed?cid=2CE060CF4F2B012E&resid=2CE060CF4F2B012E%2182849&authkey=AGUPPRF3g_Qmaew
    • Rfsvieira
      Gui - Child Gui and Tab
      By Rfsvieira
      Hello, i was working in two tipes of design have difirent problems for the same design
      1st one i was making child gui for all tabs and sub tabs
      -problems:
      to big the code, for the tab1 its go back, but tab 2 doesn t move if for item 3, but i have to declarate 20 child guis in the end if it of course not now
      2nd one i make child guid only for the sub tabs
      problems:
      doesnt go back from tab 1 to tab, and from tab2 to tab1, wen enter in  tab1 doesnt charge the buttons, only if i click in outher tab item and go back the button appear
      CODE 1 - BIG MESSI
      #include <GuiTab.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> $GUI = GUICreate("", 450, 600, 0, 0); BitOR($WS_SIZEBOX, $WS_MINIMIZEBOX)) ;GUICtrlCreateMenu("") ;GUISetBkColor(0x940F1B) GUISetIcon("hunosicon.ico") $Pic1 = GUICtrlCreatePic("img\App\barra.jpg", 0, 0, 450, 120) $Button1 = GUICtrlCreateButton("FIRST TAB ITEM A", 0, 580, 450, 20) $Tab = GUICtrlCreateTab(1,120) GUICtrlCreateTabItem("A") ;GUICtrlSetState(-1, $GUI_SHOW) GUICtrlCreateTabItem("B") GUICtrlCreateTabItem("C") GUICtrlCreateTabItem("D") GUICtrlCreateTabItem("E") GUICtrlCreateTabItem("") GUISetState() ; //////////////////////////////A\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_1 = GUICreate("", 450, 440, 0, 140, BitOR($WS_POPUP, 0), $WS_EX_MDICHILD, $GUI) GUISetBkColor(0xE0A652) GUISetState(@SW_SHOW) ; //////////////////////////////B\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_2 = GUICreate("", 450, 440, 0, 140, BitOR($WS_POPUP, 1), $WS_EX_MDICHILD, $GUI) GUISetBkColor(0xAAAAAAA) GUISetState(@SW_HIDE) ; //////////////////////////////C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_3 = GUICreate("", 445, 440, 0, 140, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $GUI) GUISetBkColor(0xAAAEEAA) GUISetState(@SW_HIDE) ; //////////////////////////////D\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_4 = GUICreate("", 445, 440, 0, 120, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $GUI) GUISetBkColor(0xAAAEEAA) $Tab1 = GUICtrlCreateTab(0,0,455,440,$tcs_buttons) _GUICtrlTab_SetBkColor($GUI_Child_4, $Tab1, 0xFFCCCC) GUICtrlCreateTabItem("<----") GUICtrlCreateTabItem("11") GUICtrlCreateTabItem("22") GUICtrlCreateTabItem("33") GUICtrlCreateTabItem("44") GUICtrlCreateTabItem("55") GUICtrlCreateTabItem("66") GUICtrlCreateTabItem("") GUISetState(@SW_HIDE) ; //////////////////////////////E\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_5 = GUICreate("", 445, 440, 0, 140, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $GUI) GUISetBkColor(0xAAAEEAA) GUISetState(@SW_HIDE) ; //////////////////////////////11\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_6 = GUICreate("", 445, 440, 0, 120, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $GUI) GUISetBkColor(0xAAAE6AA) $Tab2 = GUICtrlCreateTab(0,0,455,440,$tcs_buttons) _GUICtrlTab_SetBkColor($GUI_Child_6, $Tab2, 0xFFAACC) GUICtrlCreateTabItem("<----") GUICtrlCreateTabItem("H2O") GUICtrlCreateTabItem("CO2") GUICtrlCreateTabItem("H2") GUICtrlCreateTabItem("O2") GUICtrlCreateTabItem("") GUISetState(@SW_HIDE) ; //////////////////////////////22\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_7 = GUICreate("", 445, 440, 0, 140, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $GUI) GUISetBkColor(0xAAAEEAA) GUISetState(@SW_HIDE) While 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $Tab $SelTab = _GUICtrlTab_GetCurSel($Tab) _GUICtrlTab_SetCurSel($Tab1, 2) ;_GUICtrlTab_SetCurSel($Tab2, 1) Switch $SelTab Case 0 ;A GUISetState(@SW_HIDE,$GUI_Child_7) GUISetState(@SW_HIDE,$GUI_Child_6) GUISetState(@SW_HIDE,$GUI_Child_5) GUISetState(@SW_HIDE,$GUI_Child_4) GUISetState(@SW_HIDE,$GUI_Child_3) GUISetState(@SW_HIDE,$GUI_Child_2) GUISetState(@SW_SHOW,$GUI_Child_1) Case 1 ;B GUISetState(@SW_HIDE,$GUI_Child_7) GUISetState(@SW_HIDE,$GUI_Child_6) GUISetState(@SW_HIDE,$GUI_Child_5) GUISetState(@SW_HIDE,$GUI_Child_1) GUISetState(@SW_SHOW,$GUI_Child_2) GUISetState(@SW_HIDE,$GUI_Child_3) GUISetState(@SW_HIDE,$GUI_Child_4) Case 2 ;C GUISetState(@SW_HIDE,$GUI_Child_7) GUISetState(@SW_HIDE,$GUI_Child_6) GUISetState(@SW_HIDE,$GUI_Child_5) GUISetState(@SW_HIDE,$GUI_Child_4) GUISetState(@SW_SHOW,$GUI_Child_3) GUISetState(@SW_HIDE,$GUI_Child_2) GUISetState(@SW_HIDE,$GUI_Child_1) Case 3 ;D GUISetState(@SW_HIDE,$GUI_Child_7) GUISetState(@SW_HIDE,$GUI_Child_6) GUISetState(@SW_HIDE,$GUI_Child_5) GUISetState(@SW_SHOW,$GUI_Child_4) GUISetState(@SW_HIDE,$GUI_Child_3) GUISetState(@SW_HIDE,$GUI_Child_2) GUISetState(@SW_HIDE,$GUI_Child_1) Case 4 ;E GUISetState(@SW_HIDE,$GUI_Child_7) GUISetState(@SW_HIDE,$GUI_Child_6) GUISetState(@SW_SHOW,$GUI_Child_5) GUISetState(@SW_HIDE,$GUI_Child_4) GUISetState(@SW_HIDE,$GUI_Child_3) GUISetState(@SW_HIDE,$GUI_Child_2) GUISetState(@SW_HIDE,$GUI_Child_1) EndSwitch Case $Tab1 ; NUMBERS Tab $SelTab1 = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab2, 1) Switch $SelTab1 Case 0 _GUICtrlTab_ClickTab($Tab, 0, "left", False, 1, 100) Case 1 ;11 GUISetState(@SW_HIDE,$GUI_Child_7) GUISetState(@SW_SHOW,$GUI_Child_6) GUISetState(@SW_HIDE,$GUI_Child_5) GUISetState(@SW_HIDE,$GUI_Child_4) GUISetState(@SW_HIDE,$GUI_Child_3) GUISetState(@SW_HIDE,$GUI_Child_2) GUISetState(@SW_HIDE,$GUI_Child_1) Case 2; 22 GUISetState(@SW_SHOW,$GUI_Child_7) GUISetState(@SW_HIDE,$GUI_Child_6) GUISetState(@SW_HIDE,$GUI_Child_5) GUISetState(@SW_HIDE,$GUI_Child_4) GUISetState(@SW_HIDE,$GUI_Child_3) GUISetState(@SW_HIDE,$GUI_Child_2) GUISetState(@SW_HIDE,$GUI_Child_1) EndSwitch Case $Tab2 ; TABLE PER $SelTab2 = _GUICtrlTab_GetCurSel($Tab2) ;_GUICtrlTab_SetCurSel($Tab1, 2) Switch $SelTab2 Case 0 ;MsgBox("0", "tttt", "hehhheh") _GUICtrlTab_ClickTab($Tab, 3, "left", False, 1, 100); IF I CHANGE TO 2 IT MOVE EndSwitch Case $Button1 _GUICtrlTab_ClickTab($Tab, 0, "left", False, 1, 100) EndSwitch WEnd Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor) Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32) Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1) GUICtrlCreateLabel("", $aTabPos[0]+2, $aTabPos[1]+$aTab_Rect[3]+4, $aTabPos[2]-6, $aTabPos[3]-$aTab_Rect[3]-7) GUICtrlSetBkColor(-1, $sBkColor) GUICtrlSetState(-1, $GUI_DISABLE) EndFuncCODE 2 I THINK IS THE BETHER OPTION IF WORKS
      #include <GuiTab.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> ; //////////////////////////////MENU\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ; $GUI = GUICreate("", 450, 600, 0, 0); BitOR($WS_SIZEBOX, $WS_MINIMIZEBOX)) ;GUICtrlCreateMenu("") ;GUISetBkColor(0x940F1B) GUISetIcon("hunosicon.ico") $Pic1 = GUICtrlCreatePic("img\App\barra.jpg", 0, 0, 450, 120) $Button1 = GUICtrlCreateButton("BACK TO GUI", 0, 580, 450, 20); TESTE BUTON $Tab = GUICtrlCreateTab(1,120) GUICtrlCreateTabItem("A") $Button1 = GUICtrlCreateButton("AAAAAAA", 16, 254, 75, 25) ;GUICtrlSetState(-1, $GUI_SHOW) GUICtrlCreateTabItem("B") $Button2 = GUICtrlCreateButton("BBBBBBBB", 16, 254, 75, 25) GUICtrlCreateTabItem("C") GUICtrlCreateTabItem("D") GUICtrlCreateTabItem("E") GUICtrlCreateTabItem("") GUISetState() ; //////////////////////////////MENU1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ $GUI_Child_1 = GUICreate("", 450, 440, 0, 120, BitOR($WS_POPUP, 0), $WS_EX_MDICHILD, $GUI) ;GUISetBkColor(0xE0A652) $Tab1 = GUICtrlCreateTab(0,0,455,440,$tcs_buttons) ; _GUICtrlTab_SetBkColor($GUI_Child_1, $Tab1, 0xFFCCCC) GUICtrlCreateTabItem("<----") GUICtrlCreateTabItem("11") GUICtrlCreateTabItem("22") $Button3 = GUICtrlCreateButton("222222", 16, 254, 75, 25) GUICtrlCreateTabItem("33") GUICtrlCreateTabItem("44") GUICtrlCreateTabItem("55") GUICtrlCreateTabItem("66") GUICtrlCreateTabItem("") GUISetState(@SW_HIDE) ; //////////////////////////////MENU 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ;<---, CASTELO PRINCIPAL, PA1, PA2, PA3 $GUI_Child_2 = GUICreate("", 445, 440, 0, 120, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $GUI) ;GUISetBkColor(0xAAAE6AA) $Tab2 = GUICtrlCreateTab(0,0,455,440,$tcs_buttons) ; _GUICtrlTab_SetBkColor($GUI_Child_2, $Tab2, 0xFFAACC) GUICtrlCreateTabItem("<----") GUICtrlCreateTabItem("H2O") $Button4 = GUICtrlCreateButton("WATER C", 16, 254, 75, 25) GUICtrlCreateTabItem("CO2") GUICtrlCreateTabItem("H2") GUICtrlCreateTabItem("02") GUICtrlCreateTabItem("") GUISetState(@SW_HIDE) While 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $Tab $SelTab = _GUICtrlTab_GetCurSel($Tab) _GUICtrlTab_SetCurSel($Tab1, 2) ;_GUICtrlTab_SetCurSel($Tab2, 1) Switch $SelTab Case 3 GUISetState(@SW_HIDE,$GUI_Child_2) GUISetState(@SW_SHOW,$GUI_Child_1) EndSwitch Case $Tab1 ; $SelTab1 = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab2, 1) Switch $SelTab1 Case 0 ;MsgBox("0", "tttt", "hehhheh") _GUICtrlTab_ClickTab($Tab, 0, "left", False, 1, 100); GO BACK TO MENU Case 1 GUISetState(@SW_SHOW,$GUI_Child_2) GUISetState(@SW_HIDE,$GUI_Child_1) EndSwitch Case $Tab2 ; $SelTab2 = _GUICtrlTab_GetCurSel($Tab2) ;_GUICtrlTab_SetCurSel($Tab1, 2) Switch $SelTab2 Case 0 ;MsgBox("0", "tttt", "h55555") _GUICtrlTab_ClickTab($Tab, 0, "left", False, 1, 100); GO BACK TO MENU1 EndSwitch Case $Button1 _GUICtrlTab_ClickTab($Tab, 0, "left", False, 1, 100) EndSwitch WEnd Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor) Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32) Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1) GUICtrlCreateLabel("", $aTabPos[0]+2, $aTabPos[1]+$aTab_Rect[3]+4, $aTabPos[2]-6, $aTabPos[3]-$aTab_Rect[3]-7) GUICtrlSetBkColor(-1, $sBkColor) GUICtrlSetState(-1, $GUI_DISABLE) EndFuncAny idea?
      I have been Reading a lot of the help file and web, but didnt get
      Thanks
    • Yashied
      Skin UDF
      By Yashied
      LAST VERSION - 0.2
      03-Jan-15

      Skin UDF allows you to create buttons from the predefined images (files, resources, etc.). I rewrote this library by using GDI+ (first version used GDI). This allowed add the many additional features and get rid of the problems related to the transparency. Nevertheless, the library has a beta status, so there is no detailed description of the functions. But I am sure that the example below gives complete information about the features of this library. I hope that many users will find it useful. If you will have any questions, please ask them in this thread.
       


      Available functions
      Skin Library v1.0
      Skin.zip

      Example
      #Include <GUIConstantsEx.au3> #Include <Skin.au3> Global $Button[3] $hForm = GUICreate('MyGUI', 278, 106) GUICtrlCreatePic('background.bmp', 0, 0, 278, 106) GUICtrlSetState(-1, $GUI_DISABLE) ; Create buttons from PNG images (images should be located in the same folder as the script) $Button[0] = _Skin_AddButton(20 , 20, 66, 66, 'red_normal.png', 'red_hover.png', 'red_click.png', 'disable.png', 'alpha.png', 1) $Button[1] = _Skin_AddButton(106, 20, 66, 66, 'yellow_normal.png', 'yellow_hover.png', 'yellow_click.png', 'disable.png', 'alpha.png', 1) $Button[2] = _Skin_AddButton(192, 20, 66, 66, 'green_normal.png', 'green_hover.png', 'green_click.png', 'disable.png', 'alpha.png', 1) #cs ; Create buttons from GDI+ HBITMAP handles $Button[0] = _Skin_AddButtonEx(20 , 20, 64, 64, _GDIPlus_BitmapCreateFromFile('red_normal.png'), ..., 1, 1) $Button[1] = _Skin_AddButtonEx(104, 20, 64, 64, _GDIPlus_BitmapCreateFromFile('yellow_normal.png'), ..., 1, 1) $Button[2] = _Skin_AddButtonEx(188, 20, 64, 64, _GDIPlus_BitmapCreateFromFile('green_normal.png'), ..., 1, 1) #ce ; Disable "Yellow" button (Optional) _Skin_DisableButton($Button[1], 1) ; Enable keyboard input (Optional) _Skin_EnableKBInput(1) ; Set margins for dotted focus rectangle (Optional) For $i = 0 To 2 _Skin_SetFocusRect($Button[$i], 5, 5, 56, 56) Next ; Enable dotted focus rectangle (Optional) _Skin_EnableFocus(1) GUISetState() ; _Skin_Helper() must be called continuously in the main loop While 1 _Skin_Helper($hForm) $ID = GUIGetMsg() Switch $ID Case 0 ContinueLoop Case $GUI_EVENT_CLOSE ExitLoop Case $Button[0] ConsoleWrite('Red' & @CR) Case $Button[1] ConsoleWrite('Yellow' & @CR) Case $Button[2] ConsoleWrite('Green' & @CR) Case Else EndSwitch WEnd ; You must delete all created buttons before destroying the appropriate window ;~For $i = 0 To 2 ;~ _Skin_DeleteButton($Button[$i]) ;~Next
    • GordonFreeman
      How to get icon associated with an extension
      By GordonFreeman
      Hi friends!
      I making a listview who displays files and i need set correct icon example: If computer have installed WinRAR zip files will have winrar icon, if have installed adobe reader pdf files have adobe reader icon. I trying to find a way to get icon associated with a extension on the computer, to after put in my listview. Thanks in advance.