Sign in to follow this  
Followers 0
FireFox

GUI Panel UDF : Manage child GUIs as panel ctrls

3 posts in this topic

#1 ·  Posted (edited)

Hi,
I was wondering why there is no panel control in autoit, this can be useful for moving/hidding more than one control at time. I have made some searches and I found nothing on it so I decided to create an UDF on it.

In order to do that, It creates child GUIs and you can manage it as real controls (coord mode based on the parent GUI and not on the screen), so I have made it to be really easy in use like any other ctrl.

Preview :
8ii.png

Example :

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include "GUIPanel_UDF.au3"

Opt("GUIOnEventMode", 1)

Global $sLogo4imgPath = @ProgramFilesDir & "\AutoIt3\Examples\GUI\logo4.gif"
Global $iPanel1step = 0, $iPanel3step = 0

#region GUI
$GUI = GUICreate("GUIPanel UDF - Example", 400, 350)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

GUICtrlCreateLabel("Label on the GUI", 300, 320)

#region Panel1
$hPanel1 = _GUICtrlPanel_Create($GUI, "Coords", 10, 40, 200, 50)
_GUICtrlPanel_SetBackground($hPanel1, 0xFF0000)

GUICtrlCreateLabel("Label on the Panel1", 5, 5, 95, 13)

$btnPanel1 = GUICtrlCreateButton("Swap with Panel4", 10, 20, 100, 22)
GUICtrlSetOnEvent($btnPanel1, "_Panel1_BtnEvent")
#endregion Panel1

#region Panel2
$hPanel2 = _GUICtrlPanel_Create($GUI, "BottomLeft", 0, 0, 200, 100, $WS_BORDER, @SW_SHOWNA, 0x00FF00)

GUICtrlCreateLabel("Label on the Panel2", 5, 5, 95, 13)

#region Panel2Sub
$hPanel2Sub = _GUICtrlPanel_Create($hPanel2, "CenterRight", 0, 0, 120, 30, $WS_BORDER, @SW_SHOWNA)

Global $aGUIPanelExample_Panel2SubPos = _GUICtrlPanel_GetPos($hPanel2Sub)
GUICtrlCreateLabel("Pos (X, Y) : " & $aGUIPanelExample_Panel2SubPos[0] & ", " & $aGUIPanelExample_Panel2SubPos[1], 5, 8, 100, 13)
#endregion
#endregion Panel2

#region Panel3
$hPanel3 = _GUICtrlPanel_Create($GUI, "Centered", 0, 0, 169, 68, $WS_BORDER, @SW_SHOWNA, $sLogo4imgPath)

$btnPanel3 = GUICtrlCreateButton("Move me", 10, 10, 70, 22)
GUICtrlSetOnEvent($btnPanel3, "_Panel3_BtnEvent")

GUICtrlCreateCheckbox("no event", 70, 55, 68, 13)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#endregion Panel3

#region Panel4
$hPanel4 = _GUICtrlPanel_Create($GUI, "TopRight", 0, 0, 100, 50, $WS_BORDER)

GUICtrlCreateCombo("Panel4", 10, 10, 80)
#endregion Panel4

GUISetState(@SW_SHOW, $GUI)
#endregion GUI

While 1
    Sleep(1000)
WEnd

Func _Panel3_BtnEvent()
    Switch $iPanel3step
        Case 0
            _GUICtrlPanel_SetPos($hPanel3, "CenterRight")
            GUICtrlSetData($btnPanel3, "Hide me")
        Case 1
            _GUICtrlPanel_SetState($hPanel3, @SW_HIDE)
    EndSwitch

    $iPanel3step += 1
EndFunc   ;==>_Panel3_BtnEvent

Func _Panel1_BtnEvent()
    Switch $iPanel1step
        Case 0
            _GUICtrlPanel_SetPos($hPanel1, "TopRight")
            _GUICtrlPanel_SetPos($hPanel4, "Coords", 10, 40)

            GUICtrlSetData($btnPanel1, "Disable me")
        Case 1
            _GUICtrlPanel_SetState($hPanel1, @SW_DISABLE)
            GUICtrlSetData($btnPanel1, "Disabled")
    EndSwitch

    $iPanel1step += 1
EndFunc   ;==>_Panel1_BtnEvent

Func _Exit()
    Exit
EndFunc   ;==>_Exit

Attachments :

GUIPanel_UDF.au3 (Previous: 279 downloads)

GUIPanel_Example.au3

Enjoy ! :blink:

Edited by FireFox
1 person likes this

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

I was wondering why there is no panel control in autoit, this can be useful for moving/hidding more than one control at time. I have made some searches and I found nothing on it so I decided to create an UDF on it.

There is no seperate control, because it's already possible with just a normal GUI:

#include
#include


$ParentGUI = GUICreate("dsdsd", 640, 480)

$Panel = GUICreate("", 100, 100, 10, 10, $WS_CHILD+$WS_VISIBLE, -1, $ParentGUI)
GUISetBkColor(0xFF0000, $Panel)

GUISetState(@SW_SHOW, $ParentGUI)

While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Edited by Kip

Share this post


Link to post
Share on other sites

There is no seperate control, because it's already possible with just a normal GUI

Yes, that's what I've done :>

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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

    • Skysnake
      By Skysnake
      Hi
      Maybe I am just being silly, but I don't understand what is supposed to happen here.
      ::/html/functions/GUICreate.htm
      GuiCreate from the Help file has 2 examples.  Specifically, the 2nd example creates a ChildGui.  Or so it says.  I do not see this on screen.
      $hGUI gets created, no problem.
      Local $hChild = GUICreate("ChildGui", 10, 10, 20, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI) What exactly does this line do? Should I see it on screen?
      Skysnake
    • spuuunit
      By spuuunit
      This is what I'm trying to do: In Firefox, if you hold down CTRL + C for about 200ms, then press CTRL + T. This is my code:
      While WinActive(" - Mozilla Firefox") If _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Then $timer = TimerInit() While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) $diff = TimerDiff($timer) If $diff > 200 Then Send("^{T}") While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) WEnd EndIf WEnd EndIf WEnd The problem is that the CTRL key gets stuck down after Send("^{T}"). I found this, but what I understand that happens when I release, and that is not what I want. The "General unstuck method" did nothing.
    • antonioj84
      By antonioj84
      #include <GUIConstantsEx.au3> #include "GUIExtender.au3" $hGUI = GUICreate("Move Example", 250, 230) GUICtrlCreateGroup(" Choose Orientation ", 10, 10, 230, 80) $cRadio_Horz = GUICtrlCreateRadio(" Horizontal ", 20, 30, 100, 20) GUICtrlSetState(-1, $GUI_CHECKED) $cRadio_Vert = GUICtrlCreateRadio(" Vertical ", 20, 60, 100, 20) GUICtrlCreateGroup(" Choose Move Style ", 10, 100, 230, 110) $cRadio_0 = GUICtrlCreateRadio(" Fix Left ", 20, 120, 100, 20) $cRadio_1 = GUICtrlCreateRadio(" Fix Centre ", 20, 150, 100, 20) $cRadio_2 = GUICtrlCreateRadio(" Fix Right ", 20, 180, 100, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cRadio_Horz GUICtrlSetData($cRadio_0, " Fix Left ") GUICtrlSetState($cRadio_0, $GUI_UNCHECKED) GUICtrlSetState($cRadio_1, $GUI_UNCHECKED) GUICtrlSetData($cRadio_2, " Fix Right ") GUICtrlSetState($cRadio_2, $GUI_UNCHECKED) Case $cRadio_Vert GUICtrlSetData($cRadio_0, " Fix Top ") GUICtrlSetState($cRadio_0, $GUI_UNCHECKED) GUICtrlSetState($cRadio_1, $GUI_UNCHECKED) GUICtrlSetData($cRadio_2, " Fix Bottom ") GUICtrlSetState($cRadio_2, $GUI_UNCHECKED) Case $cRadio_0 _Create_GUI(0) Case $cRadio_1 _Create_GUI(1) Case $cRadio_2 _Create_GUI(2) EndSwitch WEnd Func _Create_GUI($iMove) Local $sTitle Switch $iMove Case 0 If GUICtrlRead($cRadio_Horz) = 1 Then $sTitle = "Fixed Left" Else $sTitle = "Fixed Top" EndIf Case 1 $sTitle = "Fixed Centre" Case 2 If GUICtrlRead($cRadio_Horz) = 1 Then $sTitle = "Fixed Right" Else $sTitle = "Fixed Bottom" EndIf EndSwitch GUISetState(@SW_HIDE, $hGUI) $hGUI_Ex = GUICreate($sTitle, 500, 500) If GUICtrlRead($cRadio_Horz) = 1 Then _GUIExtender_Init($hGUI_Ex, 1, $iMove) _GUIExtender_Section_Create($hGUI_Ex, 0, 250) _GUIExtender_Section_Activate($hGUI_Ex, 2, "", "", 220, 10, 20, 20) _GUIExtender_Section_Create($hGUI_Ex, 250, 250) GUICtrlCreateLabel("", 250, 0, 250, 500) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI_Ex, -99) Else _GUIExtender_Init($hGUI_Ex, 0, $iMove) _GUIExtender_Section_Create($hGUI_Ex, 250, 0) _GUIExtender_Section_Activate($hGUI_Ex, 2, "", "", 470, 220, 20, 20) _GUIExtender_Section_Create($hGUI_Ex, 250, 250) GUICtrlCreateLabel("", 0, 250, 500, 250) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI_Ex, -99) EndIf _GUIExtender_Section_Action($hGUI_Ex, 2, False) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE GUISetState(@SW_SHOW, $hGUI) GUIDelete($hGUI_Ex) _GUIExtender_Clear($hGUI_Ex) ExitLoop EndSwitch _GUIExtender_EventMonitor($aMsg[1], $aMsg[0]) ; Check for click on Action control WEnd EndFunc I am trying to implement 2 side window toggle hide and show with 2 different menu.  can someone give me some direction  thanks

    • Rfsvieira
      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) EndFunc CODE 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) EndFunc Any idea?
      I have been Reading a lot of the help file and web, but didnt get
      Thanks
    • Danyfirex
      By Danyfirex
      Hi Mate. Some times we need to launch a control panel item to users. So I Implemented an IOpenControlPanel Interface. It allows to launch control panel items easily.
      #include "ControlPanelConstants.au3" Global Const $sCLSID_OpenControlPanel = "{06622D85-6856-4460-8DE1-A81921B41C4B}" Global Const $sIID_IOpenControlPanel = "{D11AD862-66DE-4DF4-BF6C-1F5621996AF1}" Global Const $sTagIOpenControlPanel= "Open hresult(wstr;wstr;ptr);GetPath hresult(wstr;wstr;uint);GetCurrentView hresult(int*)" Local $oOpenControlPanel = ObjCreateInterface($sCLSID_OpenControlPanel, $sIID_IOpenControlPanel, $sTagIOpenControlPanel) $oOpenControlPanel.Open($MicrosoftAdministrativeTools,"",Null) $oOpenControlPanel.Open($MicrosoftDateAndTime,$AdditionalClocks,Null) $oOpenControlPanel.Open($MicrosoftDefaultPrograms,$pageDefaultProgram,Null) $oOpenControlPanel.Open($GUID_MicrosoftDeviceManager,"",Null) $oOpenControlPanel.Open($GUID_MicrosoftDevicesAndPrinters,"",Null) $oOpenControlPanel.Open($MicrosoftHomeGroup,"",Null) $oOpenControlPanel.Open($MicrosoftInternetOptions,$Connections,Null) $oOpenControlPanel.Open($MicrosoftPersonalization,$pageWallpaper,Null) $oOpenControlPanel=0;Free  ControlPanelConstants.au3
      Saludos