Jump to content

how to tell what tab you are on in GUICtrlCreateTab


kor
 Share

Recommended Posts

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Tabbed Notebook Dialog", 527, 369, 299, 218)
$PageControl1 = GUICtrlCreateTab(8, 8, 396, 256)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$Input1 = GUICtrlCreateInput("Input1", 88, 96, 145, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
GUICtrlSetState(-1,$GUI_SHOW)
$Input2 = GUICtrlCreateInput("Input2", 80, 80, 161, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("&OK", 166, 272, 75, 25)
$Button2 = GUICtrlCreateButton("&Cancel", 246, 272, 75, 25)
$Button3 = GUICtrlCreateButton("&Help", 328, 272, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd

That is the default output from a test gui in Koda. I don't have my code im working on with me at the moment but the example should be enough to get across what I'm trying to do.

If a user is working with inputs on tab1, then clicks OK I want to preform action 1.

However if that user is working with inputs from tab2 and clicks the same OK button, I want to preform action 2. How can I make that OK button do different things depending on what tab the user is working on?

Link to comment
Share on other sites

GUICtrlRead($PageControl1)

Tabs are 0 based so the first tabitem is tab 0

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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