Sign in to follow this  
Followers 0
shawnmstout

Load Tab Item WHen Clicked

4 posts in this topic

#1 ·  Posted (edited)

$driveTab = GUICtrlCreateTabItem("Hard Drives")

GetDriveInfo()

$biosTab = GUICtrlCreateTabItem("Bios")

getBios()

$serviceTab = GUICtrlCreateTabItem("Services")

getServices()

$processTab = GUICtrlCreateTabItem("Running Processes")

getRunningProcesses()

$displayTab = GUICtrlCreateTabItem("Display")

getDisplay()

$systemTab = GUICtrlCreateTabItem("System")

GetSystemInfo()

$printTab = GUICtrlCreateTabItem("Print")

GetPrintJobs()

$softwareTab = GUICtrlCreateTabItem("Software")

GetSoftware()

$startupTab = GUICtrlCreateTabItem("Startup")

GetStartup()

is there a way to start the function when the tab is clicked?

the load time on the functions are pretty severe so im trying to only run it when it gets clicked

Edited by shawnmstout

Share this post


Link to post
Share on other sites



You can use Tab's like buttons, e.g. if you use MessageLoop check for $biosTab or use CtrlSetOnEvent if you use OnEvent.

can you give me an example, i starting trying this, but its not working

While 1

If _GUICtrlTab_GetItem($sysTabs) == $driveTab Then MsgBox(0,"","Test")

If GUIGetMsg() = -3 Then

ExitLoop

EndIf

WEnd

Share this post


Link to post
Share on other sites

Here's one way:

#include <GUIConstantsEx.au3>

GUICreate("test", 640, 320)

$tab = GUICtrlCreateTab(10, 10)
$tab1 = GUICtrlCreateTabItem("tab----1")
$tab2 = GUICtrlCreateTabItem("tab----2")
GUICtrlCreateTabItem("")

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $tab
            Switch GUICtrlRead($tab, 1)
                Case $tab1
                    MsgBox(0, "Something", "You pressed on: tab----1")
                Case $tab2
                    MsgBox(0, "Something", "You pressed on: tab----2")
            EndSwitch
    EndSelect
WEnd

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