Jump to content
Sign in to follow this  
Edifice

Multiple Tabs-controls "in tab"

Recommended Posts

Edifice

I have this piece of GUI-making that works (almost). (Thanks to brettf for the nice basic code I used :))

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

Global Const $CBS_DROPDOWNLIST = 0x0003
Dim $salesman = ""

$hGUI = GUICreate ("GUI Test", 500, 700)
$hTabs = GUICtrlCreateTab (0, 0, 500, 700)
$hTabPage1 = GUICtrlCreateTabItem ("Tab 1")
        $label_ditnavn      = GUICtrlCreateLabel("Dit Navn: ",              10,     33,     100,    20,     2)
        $combo_modtager     = GUICtrlCreateCombo("Alf",                     110,    30,     70,     20,     $CBS_DROPDOWNLIST); create first item
        GUICtrlSetData($combo_modtager, "Claus|Lasse|Per|Jacob|Toke"); add other item
        GUICtrlCreateLabel(@MDAY & " - " & @MON & " - " & @YEAR & " _ " & @HOUR & " - " & @MIN & " - " & @SEC, 200, 33, 300, 20, 0)
        $label_navn         = GUICtrlCreateLabel("Navn:  ",                 10,     58,     100,    20,     2)
        $input_navn         = GUICtrlCreateInput("",                        110,    55,     300,    20,     0)
        $label_tlfnr        = GUICtrlCreateLabel("Telefonnummer:  ",        10,     83,     100,    20,     2)
        $input_tlfnr        = GUICtrlCreateInput("",                        110,    80,     300,    20,     0)
        $label_indleveret   = GUICtrlCreateLabel("Indleveret produkt:  ",   10,     108,    100,    20,     2)
        $combo_indleveret   = GUICtrlCreateCombo("Almindelig PC",       110,    105,    200,    20,     $CBS_DROPDOWNLIST); create first item
        GUICtrlSetData($combo_indleveret, "Bærbar Computer|Hardware|Andet"); add other item snd set a new default
$hTabPage2 = GUICtrlCreateTabItem ("Tab 2")


$hpc = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    $hpcTabs = GUICtrlCreateTab (0, 0, 500, 300)
    $hpcTabPage1 = GUICtrlCreateTabItem ("test1")
    $hpcTabPage2 = GUICtrlCreateTabItem ("test2")
    $hpcTabPage3 = GUICtrlCreateTabItem ("test3")


$hlaptop = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    $hlaptopTabs = GUICtrlCreateTab (0, 0, 500, 300)
    $hlaptopTabPage1 = GUICtrlCreateTabItem ("Beskrivelse")
    $hlaptopTabPage2 = GUICtrlCreateTabItem ("Tilbehør")
    $hlaptopTabPage3 = GUICtrlCreateTabItem ("Fejlbeskrivelse")


$hhardware = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    $hhardwareTabs = GUICtrlCreateTab (0, 0, 500, 300)
    $hhardwareTabPage1 = GUICtrlCreateTabItem ("tab1")
    $hhardwareTabPage2 = GUICtrlCreateTabItem ("tab2")
    $hhardwareTabPage3 = GUICtrlCreateTabItem ("tab3")


$handet = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    $handetTabs = GUICtrlCreateTab (0, 0, 500, 300)
    $handetTabPage1 = GUICtrlCreateTabItem ("testtab1")
    $handetTabPage2 = GUICtrlCreateTabItem ("testtab2")
    $handetTabPage3 = GUICtrlCreateTabItem ("testtab3")


GUISetState (@SW_SHOW, $hGUI)
While 1
    $nMsg = GUIGetMsg ()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case GUICtrlRead ($combo_indleveret, 1) = "Almindelig PC"
                GUISetState (@SW_SHOW, $hpc)
                GUISetState (@SW_HIDE, $hlaptop)
                GUISetState (@SW_HIDE, $hhardware)
                GUISetState (@SW_HIDE, $handet)
        Case GUICtrlRead ($combo_indleveret, 1) = "Bærbar Computer"
                GUISetState (@SW_HIDE, $hpc)
                GUISetState (@SW_SHOW, $hlaptop)
                GUISetState (@SW_HIDE, $hhardware)
                GUISetState (@SW_HIDE, $handet)
        Case GUICtrlRead ($combo_indleveret, 1) = "Hardware"
                GUISetState (@SW_HIDE, $hpc)
                GUISetState (@SW_HIDE, $hlaptop)
                GUISetState (@SW_SHOW, $hhardware)
                GUISetState (@SW_HIDE, $handet)
        Case GUICtrlRead ($combo_indleveret, 1) = "Andet"
                GUISetState (@SW_HIDE, $hpc)
                GUISetState (@SW_HIDE, $hlaptop)
                GUISetState (@SW_HIDE, $hhardware)
                GUISetState (@SW_SHOW, $handet)
        Case GUICtrlRead ($hTabs, 1) = $hTabPage2
                MsgBox(0, "Test", "Running...")
                GUISetState (@SW_HIDE, $hpc)
                GUISetState (@SW_HIDE, $hlaptop)
                GUISetState (@SW_HIDE, $hhardware)
                GUISetState (@SW_HIDE, $handet)
    EndSelect
WEnd

You may notice the

MsgBox(0, "Test", "Running...")

at the 7. line from the bottom.

I created that because I cannot grasp why on earth it doesn't run that Case when I press $hTabPage2.

Also, whenever I use the Combocontrol it jumps to the GUI that is showed, making it close to impossible to use.

I really hope you guys can help me out with this! :)

Edited by Edifice

Share this post


Link to post
Share on other sites
martin

I have this piece of GUI-making that works (almost). (Thanks to brettf for the nice basic code I used :) )

#include <WindowsConstants.au3>
 #include <GUIConstantsEx.au3>
 #include <Date.au3>
 
 Global Const $CBS_DROPDOWNLIST = 0x0003
 Dim $salesman = ""
 
 $hGUI = GUICreate ("GUI Test", 500, 700)
 $hTabs = GUICtrlCreateTab (0, 0, 500, 700)
 $hTabPage1 = GUICtrlCreateTabItem ("Tab 1")
         $label_ditnavn     = GUICtrlCreateLabel("Dit Navn: ",               10,     33,     100,    20,     2)
         $combo_modtager        = GUICtrlCreateCombo("Alf",                     110,     30,        70,  20,     $CBS_DROPDOWNLIST); create first item
         GUICtrlSetData($combo_modtager, "Claus|Lasse|Per|Jacob|Toke"); add other item
         GUICtrlCreateLabel(@MDAY & " - " & @MON & " - " & @YEAR & " _ " & @HOUR & " - " & @MIN & " - " & @SEC, 200, 33, 300, 20, 0)
         $label_navn             = GUICtrlCreateLabel("Navn:  ",                 10,     58,     100,    20,     2)
         $input_navn            = GUICtrlCreateInput("",                         110,    55,     300,    20,     0)
         $label_tlfnr        = GUICtrlCreateLabel("Telefonnummer:  ",       10,  83,     100,    20,     2)
         $input_tlfnr       = GUICtrlCreateInput("",                         110,    80,     300,    20,     0)
         $label_indleveret   = GUICtrlCreateLabel("Indleveret produkt:  ",  10,  108,    100,    20,     2)
         $combo_indleveret  = GUICtrlCreateCombo("Almindelig PC",        110,    105,   200,    20,     $CBS_DROPDOWNLIST); create first item
         GUICtrlSetData($combo_indleveret, "Bærbar Computer|Hardware|Andet"); add other item snd set a new default
 $hTabPage2 = GUICtrlCreateTabItem ("Tab 2")
 
 
 $hpc = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
     $hpcTabs = GUICtrlCreateTab (0, 0, 500, 300)
     $hpcTabPage1 = GUICtrlCreateTabItem ("test1")
     $hpcTabPage2 = GUICtrlCreateTabItem ("test2")
     $hpcTabPage3 = GUICtrlCreateTabItem ("test3")
 
 
 $hlaptop = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
     $hlaptopTabs = GUICtrlCreateTab (0, 0, 500, 300)
     $hlaptopTabPage1 = GUICtrlCreateTabItem ("Beskrivelse")
     $hlaptopTabPage2 = GUICtrlCreateTabItem ("Tilbehør")
     $hlaptopTabPage3 = GUICtrlCreateTabItem ("Fejlbeskrivelse")
 
 
 $hhardware = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
     $hhardwareTabs = GUICtrlCreateTab (0, 0, 500, 300)
     $hhardwareTabPage1 = GUICtrlCreateTabItem ("tab1")
     $hhardwareTabPage2 = GUICtrlCreateTabItem ("tab2")
     $hhardwareTabPage3 = GUICtrlCreateTabItem ("tab3")
 
 
 $handet = GUICreate ("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
     $handetTabs = GUICtrlCreateTab (0, 0, 500, 300)
     $handetTabPage1 = GUICtrlCreateTabItem ("testtab1")
     $handetTabPage2 = GUICtrlCreateTabItem ("testtab2")
     $handetTabPage3 = GUICtrlCreateTabItem ("testtab3")
 
 
 GUISetState (@SW_SHOW, $hGUI)
 While 1
     $nMsg = GUIGetMsg ()
     Select
         Case $nMsg = $GUI_EVENT_CLOSE
             Exit
         Case GUICtrlRead ($combo_indleveret, 1) = "Almindelig PC"
                 GUISetState (@SW_SHOW, $hpc)
                 GUISetState (@SW_HIDE, $hlaptop)
                 GUISetState (@SW_HIDE, $hhardware)
                 GUISetState (@SW_HIDE, $handet)
         Case GUICtrlRead ($combo_indleveret, 1) = "Bærbar Computer"
                 GUISetState (@SW_HIDE, $hpc)
                 GUISetState (@SW_SHOW, $hlaptop)
                 GUISetState (@SW_HIDE, $hhardware)
                 GUISetState (@SW_HIDE, $handet)
         Case GUICtrlRead ($combo_indleveret, 1) = "Hardware"
                 GUISetState (@SW_HIDE, $hpc)
                 GUISetState (@SW_HIDE, $hlaptop)
                 GUISetState (@SW_SHOW, $hhardware)
                 GUISetState (@SW_HIDE, $handet)
         Case GUICtrlRead ($combo_indleveret, 1) = "Andet"
                 GUISetState (@SW_HIDE, $hpc)
                 GUISetState (@SW_HIDE, $hlaptop)
                 GUISetState (@SW_HIDE, $hhardware)
                 GUISetState (@SW_SHOW, $handet)
         Case GUICtrlRead ($hTabs, 1) = $hTabPage2
                 MsgBox(0, "Test", "Running...")
                 GUISetState (@SW_HIDE, $hpc)
                 GUISetState (@SW_HIDE, $hlaptop)
                 GUISetState (@SW_HIDE, $hhardware)
                 GUISetState (@SW_HIDE, $handet)
     EndSelect
 WEnd

You may notice the

MsgBox(0, "Test", "Running...")

at the 7. line from the bottom.

I created that because I cannot grasp why on earth it doesn't run that Case when I press $hTabPage2.

Also, whenever I use the Combocontrol it jumps to the GUI that is showed, making it close to impossible to use.

I really hope you guys can help me out with this! :)

I'm afraid you need to rethink the design of your script ^_^, at least the Select section.

When the select section is executed the script will run the first case it finds that is true. So if you put your

Case GUICtrlRead ($hTabs, 1) = $hTabPage2

at the top of the list then you will see what you expected.

Here's one way you could chnage what you have so far.

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

Global Const $CBS_DROPDOWNLIST = 0x0003
Dim $salesman = ""

$hGUI = GUICreate("GUI Test", 500, 700)
$hTabs = GUICtrlCreateTab(0, 0, 500, 700)
$hTabPage1 = GUICtrlCreateTabItem("Tab 1")
$label_ditnavn = GUICtrlCreateLabel("Dit Navn: ", 10, 33, 100, 20, 2)
$combo_modtager = GUICtrlCreateCombo("Alf", 110, 30, 70, 20, $CBS_DROPDOWNLIST); create first item
GUICtrlSetData($combo_modtager, "Claus|Lasse|Per|Jacob|Toke"); add other item
GUICtrlCreateLabel(@MDAY & " - " & @MON & " - " & @YEAR & " _ " & @HOUR & " - " & @MIN & " - " & @SEC, 200, 33, 300, 20, 0)
$label_navn = GUICtrlCreateLabel("Navn:  ", 10, 58, 100, 20, 2)
$input_navn = GUICtrlCreateInput("", 110, 55, 300, 20, 0)
$label_tlfnr = GUICtrlCreateLabel("Telefonnummer:  ", 10, 83, 100, 20, 2)
$input_tlfnr = GUICtrlCreateInput("", 110, 80, 300, 20, 0)
$label_indleveret = GUICtrlCreateLabel("Indleveret produkt:  ", 10, 108, 100, 20, 2)
$combo_indleveret = GUICtrlCreateCombo("Almindelig PC", 110, 105, 200, 20, $CBS_DROPDOWNLIST); create first item
GUICtrlSetData($combo_indleveret, "Bжrbar Computer|Hardware|Andet"); add other item snd set a new default
$hTabPage2 = GUICtrlCreateTabItem("Tab 2")
GUICtrlCreateTabItem(""); end tabitem definition


$hpc = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hpcTabs = GUICtrlCreateTab(0, 0, 500, 300)
$hpcTabPage1 = GUICtrlCreateTabItem("test1")
$hpcTabPage2 = GUICtrlCreateTabItem("test2")
$hpcTabPage3 = GUICtrlCreateTabItem("test3")
GUICtrlCreateTabItem(""); end tabitem definition


$hlaptop = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hlaptopTabs = GUICtrlCreateTab(0, 0, 500, 300)
$hlaptopTabPage1 = GUICtrlCreateTabItem("Beskrivelse")
$hlaptopTabPage2 = GUICtrlCreateTabItem("Tilbehшr")
$hlaptopTabPage3 = GUICtrlCreateTabItem("Fejlbeskrivelse")
GUICtrlCreateTabItem(""); end tabitem definition


$hhardware = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hhardwareTabs = GUICtrlCreateTab(0, 0, 500, 300)
$hhardwareTabPage1 = GUICtrlCreateTabItem("tab1A")
$hhardwareTabPage2 = GUICtrlCreateTabItem("tab2A")
$hhardwareTabPage3 = GUICtrlCreateTabItem("tab3A")
GUICtrlCreateTabItem(""); end tabitem definition


$handet = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$handetTabs = GUICtrlCreateTab(0, 0, 500, 300)
$handetTabPage1 = GUICtrlCreateTabItem("testtab1")
$handetTabPage2 = GUICtrlCreateTabItem("testtab2")
$handetTabPage3 = GUICtrlCreateTabItem("testtab3")
GUICtrlCreateTabItem(""); end tabitem definition


GUISetState(@SW_SHOW, $hGUI)
GUISwitch($hGUI)
ConsoleWrite(GUICtrlRead($hTabs, 1) & @CRLF)
ConsoleWrite(GUICtrlRead($hTabs) & @CRLF)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $hTabs;
             ConsoleWrite("$hTab clicked" & @CRLF)
            If GUICtrlRead($hTabs, 1) = $hTabPage2 Then
              
                GUISetState(@SW_HIDE, $hpc)
                GUISetState(@SW_HIDE, $hlaptop)
                GUISetState(@SW_HIDE, $hhardware)
                GUISetState(@SW_HIDE, $handet)
            EndIf
        Case $GUI_EVENT_CLOSE;$nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $combo_indleveret;
            ConsoleWrite("Comboed!" & @CRLF)
            Select
                Case GUICtrlRead($combo_indleveret, 1) = "Almindelig PC"
                    GUISetState(@SW_SHOW, $hpc)
                    GUISetState(@SW_HIDE, $hlaptop)
                    GUISetState(@SW_HIDE, $hhardware)
                    GUISetState(@SW_HIDE, $handet)
                Case $combo_indleveret;GUICtrlRead ($combo_indleveret, 1) = "Bжrbar Computer"
                    GUISetState(@SW_HIDE, $hpc)
                    GUISetState(@SW_SHOW, $hlaptop)
                    GUISetState(@SW_HIDE, $hhardware)
                    GUISetState(@SW_HIDE, $handet)
                Case GUICtrlRead($combo_indleveret, 1) = "Hardware"
                    GUISetState(@SW_HIDE, $hpc)
                    GUISetState(@SW_HIDE, $hlaptop)
                    GUISetState(@SW_SHOW, $hhardware)
                    GUISetState(@SW_HIDE, $handet)
                Case GUICtrlRead($combo_indleveret, 1) = "Andet"
                    GUISetState(@SW_HIDE, $hpc)
                    GUISetState(@SW_HIDE, $hlaptop)
                    GUISetState(@SW_HIDE, $hhardware)
                    GUISetState(@SW_SHOW, $handet)
            EndSelect
            

    EndSwitch
WEnd

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.

Share this post


Link to post
Share on other sites
Edifice

Thanks for the input! - This really works great! :):D

However, I just remembered using interupt when coding small CPU's in C. Is there any way to use "interupt" in Auto-it?

And if so, I would be able to interupt the script on Tab2 and then execute the hides? - and proberly reset the combobox?

and if so, is that a good Idea? :)

Edited by Edifice

Share this post


Link to post
Share on other sites
KaFu

Oh, didn't even notice that :). What I was tinkering about is the redrawn, try to move the windows if a tab is visible an you'll see what I mean.

Share this post


Link to post
Share on other sites
Edifice

Oh, didn't even notice that :). What I was tinkering about is the redrawn, try to move the windows if a tab is visible an you'll see what I mean.

Yeah I did notice that. Didn't pay too much attention to it though. The users are just going to have to stop moving the windows around :)

Any way to make it go away?

Share this post


Link to post
Share on other sites
KaFu

Something with WM_MOVE and _WinAPI_RedrawWindow() should work, but didn't find a full solution yet. If you just redrawn the tabs on move, the new position is drawn correctly, but there's a blur of the old tab position still visible.

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Date.au3>
#include <winapi.au3>

Global Const $CBS_DROPDOWNLIST = 0x0003
Dim $salesman = ""

$hGUI = GUICreate("GUI Test", 500, 700)

GUIRegisterMsg($WM_MOVE, "WM_MOVE")

$hTabs = GUICtrlCreateTab(0, 0, 500, 700)
$hTabPage1 = GUICtrlCreateTabItem("Tab 1")
$label_ditnavn = GUICtrlCreateLabel("Dit Navn: ", 10, 33, 100, 20, 2)
$combo_modtager = GUICtrlCreateCombo("Alf", 110, 30, 70, 20, $CBS_DROPDOWNLIST); create first item
GUICtrlSetData($combo_modtager, "Claus|Lasse|Per|Jacob|Toke"); add other item
GUICtrlCreateLabel(@MDAY & " - " & @MON & " - " & @YEAR & " _ " & @HOUR & " - " & @MIN & " - " & @SEC, 200, 33, 300, 20, 0)
$label_navn = GUICtrlCreateLabel("Navn:  ", 10, 58, 100, 20, 2)
$input_navn = GUICtrlCreateInput("", 110, 55, 300, 20, 0)
$label_tlfnr = GUICtrlCreateLabel("Telefonnummer:  ", 10, 83, 100, 20, 2)
$input_tlfnr = GUICtrlCreateInput("", 110, 80, 300, 20, 0)
$label_indleveret = GUICtrlCreateLabel("Indleveret produkt:  ", 10, 108, 100, 20, 2)
$combo_indleveret = GUICtrlCreateCombo("Almindelig PC", 110, 105, 200, 20, $CBS_DROPDOWNLIST); create first item
GUICtrlSetData($combo_indleveret, "B?rbar Computer|Hardware|Andet"); add other item snd set a new default
$hTabPage2 = GUICtrlCreateTabItem("Tab 2")
GUICtrlCreateTabItem(""); end tabitem definition


$hpc = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hpcTabs = GUICtrlCreateTab(0, 0, 500, 300)
$hpcTabPage1 = GUICtrlCreateTabItem("test1")
$hpcTabPage2 = GUICtrlCreateTabItem("test2")
$hpcTabPage3 = GUICtrlCreateTabItem("test3")
GUICtrlCreateTabItem(""); end tabitem definition


$hlaptop = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hlaptopTabs = GUICtrlCreateTab(0, 0, 500, 300)
$hlaptopTabPage1 = GUICtrlCreateTabItem("Beskrivelse")
$hlaptopTabPage2 = GUICtrlCreateTabItem("Tilbeh?r")
$hlaptopTabPage3 = GUICtrlCreateTabItem("Fejlbeskrivelse")
GUICtrlCreateTabItem(""); end tabitem definition

$hhardware = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hhardwareTabs = GUICtrlCreateTab(0, 0, 500, 300)
$hhardwareTabPage1 = GUICtrlCreateTabItem("tab1A")
$hhardwareTabPage2 = GUICtrlCreateTabItem("tab2A")
$hhardwareTabPage3 = GUICtrlCreateTabItem("tab3A")
GUICtrlCreateTabItem(""); end tabitem definition


$handet = GUICreate("", 500, 300, 0, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$handetTabs = GUICtrlCreateTab(0, 0, 500, 300)
$handetTabPage1 = GUICtrlCreateTabItem("testtab1")
$handetTabPage2 = GUICtrlCreateTabItem("testtab2")
$handetTabPage3 = GUICtrlCreateTabItem("testtab3")
GUICtrlCreateTabItem(""); end tabitem definition


GUISetState(@SW_SHOW, $hGUI)
GUISwitch($hGUI)
ConsoleWrite(GUICtrlRead($hTabs, 1) & @CRLF)
ConsoleWrite(GUICtrlRead($hTabs) & @CRLF)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $hTabs;
             ConsoleWrite("$hTab clicked" & @CRLF)
            If GUICtrlRead($hTabs, 1) = $hTabPage2 Then
              
                GUISetState(@SW_HIDE, $hpc)
                GUISetState(@SW_HIDE, $hlaptop)
                GUISetState(@SW_HIDE, $hhardware)
                GUISetState(@SW_HIDE, $handet)
            EndIf
        Case $GUI_EVENT_CLOSE;$nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $combo_indleveret;
            ConsoleWrite("Comboed!" & @CRLF)
            Select
                Case GUICtrlRead($combo_indleveret, 1) = "Almindelig PC"
                    GUISetState(@SW_SHOW, $hpc)
                    GUISetState(@SW_HIDE, $hlaptop)
                    GUISetState(@SW_HIDE, $hhardware)
                    GUISetState(@SW_HIDE, $handet)
                Case $combo_indleveret;GUICtrlRead ($combo_indleveret, 1) = "B?rbar Computer"
                    GUISetState(@SW_HIDE, $hpc)
                    GUISetState(@SW_SHOW, $hlaptop)
                    GUISetState(@SW_HIDE, $hhardware)
                    GUISetState(@SW_HIDE, $handet)
                Case GUICtrlRead($combo_indleveret, 1) = "Hardware"
                    GUISetState(@SW_HIDE, $hpc)
                    GUISetState(@SW_HIDE, $hlaptop)
                    GUISetState(@SW_SHOW, $hhardware)
                    GUISetState(@SW_HIDE, $handet)
                Case GUICtrlRead($combo_indleveret, 1) = "Andet"
                    GUISetState(@SW_HIDE, $hpc)
                    GUISetState(@SW_HIDE, $hlaptop)
                    GUISetState(@SW_HIDE, $hhardware)
                    GUISetState(@SW_SHOW, $handet)
            EndSelect
            

    EndSwitch
WEnd

Func WM_MOVE($hWnd, $Msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hpc)
    _WinAPI_RedrawWindow($hlaptop)
    _WinAPI_RedrawWindow($hhardware)
    _WinAPI_RedrawWindow($handet)
EndFunc

Share this post


Link to post
Share on other sites
Edifice

That's just going to have to do for now, It's way better than before and it doesn't bother me. Thanks! :)

However, if I have to post it in the example section (couldn't really find this GUI in there) I'll have to fix it eventually.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.