Jump to content
Sign in to follow this  
commenti

Active TabItem?

Recommended Posts

commenti

Hi!

How can I found out which tabitem is aktually aktiv?

Example:

#include <GUIConstants.au3>

GUICreate("My GUI Test-Tab") ; will create a dialog box that when displayed is centered

GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)

$tab=GUICtrlCreateTab (10,10, 200,100)

$tab0=GUICtrlCreateTabitem ("tab0")

GUICtrlCreateLabel( "Hello",  10, 32, 642,312,0x1000) 
GUICtrlSetBkColor(-1,0xf5f5dc) 
$tab1=GUICtrlCreateTabitem ( "tab1")
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateLabel( "Hi!",  10, 32, 642,312,0x1000) 
GUICtrlSetBkColor(-1,0xffffff) 

$tab2=GUICtrlCreateTabitem ("tab2")

$test=GUICtrlCreateLabel( "Test",  10, 32, 642,312,0x1000) 
GUICtrlSetBkColor(-1,0xf123456) 
GUICtrlCreateTabitem (""); end tabitem definition


GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    $ergeb= GUICtrlGetState ( $tab1 )
  ; this is not working.... 
   if $ergeb = $GUI_SHOW then
      MsgBox (0,"test","test")
   EndIf
  ; 
  ; this is not working
   if $msg = $tab0 then
      MsgBox (0,"test","test")
   EndIf
  ;
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

So how can I find out which tabitem is actually active?

I did not find something with the neither with forum search nor in the helpfile.

commenti

Share this post


Link to post
Share on other sites
GaryFrost

#include <GUIConstants.au3>

GUICreate("My GUI Test-Tab"); will create a dialog box that when displayed is centered

GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)

$tab = GUICtrlCreateTab(10, 10, 200, 100)

$tab0 = GUICtrlCreateTabItem("tab0")

GUICtrlCreateLabel( "Hello", 10, 32, 642, 312, 0x1000)
GUICtrlSetBkColor(-1, 0xf5f5dc)
$tab1 = GUICtrlCreateTabItem("tab1")
GUICtrlSetState(-1, $GUI_SHOW)
GUICtrlCreateLabel( "Hi!", 10, 32, 642, 312, 0x1000)
GUICtrlSetBkColor(-1, 0xffffff)

$tab2 = GUICtrlCreateTabItem("tab2")

$test = GUICtrlCreateLabel( "Test", 10, 32, 642, 312, 0x1000)
GUICtrlSetBkColor(-1, 0xf123456)
GUICtrlCreateTabItem(""); end tabitem definition

$tabed = 0

GUISetState()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case GUICtrlRead($tab) = 0 And $tabed <> 0
            $tabed = 0
            MsgBox(0, "test", "tab0")
        Case GUICtrlRead($tab) = 1 And $tabed <> 1
            $tabed = 1
            MsgBox(0, "test", "tab1")
        Case GUICtrlRead($tab) = 2 And $tabed <> 2
            $tabed = 2
            MsgBox(0, "test", "tab2")
    EndSelect
WEnd

  • Like 1

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
commenti

Hello gafrost,

Thank you very much!!!!

This was very helpfull.

I still have a problem using that together with images but for the moment, its just what I needed.

Greetings...

commenti

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  

×