Jump to content

Create in Specific Tab


Recommended Posts

How do I create a new control in an already existing tab?

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

try this:

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 625, 445, 193, 115)
$Tab1 = GUICtrlCreateTab(80, 80, 393, 209)
$tabitem1 = GUICtrlCreateTabItem("Tab1")
$tabitem2 = GUICtrlCreateTabItem("Tab2")
$tabitem3 = GUICtrlCreateTabItem("Tab3")
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("Create Button to:", 112, 336, 137, 33, 0)
$combo1 = GUICtrlCreateCombo("", 250, 340, 137, 33, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "Tab1|Tab2|Tab3", "Tab1")
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            $var = guictrlread($combo1)
            if $var = "Tab1" Then
                GUISwitch($Form1,$tabitem1)
            ElseIf $var = "Tab2" Then
                GUISwitch($Form1,$tabitem2)
            Else
                GUISwitch($Form1,$tabitem3)
            EndIf
            GUICtrlCreateButton("OK!", 300, 200)
            GUICtrlCreateTabItem("")
    EndSwitch
WEnd
Link to comment
Share on other sites

  • 4 years later...

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...