Jump to content
Sign in to follow this  
HighGuy

GUICtrlSetState(controlID, $GUI_DISABLE)

Recommended Posts

I know from the history that there have been some changes made with GUICtrlSetState() and tabs. Now I have the problem that with the current beta it's not possible to disable a button on a tab. I adapted the sample code for tab creation which shows this behavior (the OK-button on tab2 isn't disabled).

#include <GUIConstants.au3>

GUICreate("My GUI 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 ("label0", 30,80,50,20)
$tab0OK=GUICtrlCreateButton ("OK0", 20,50,50,20)
$tab0input=GUICtrlCreateInput ("default", 80,50,70,20)

$tab1=GUICtrlCreateTabitem ( "tab----1")
GUICtrlCreateLabel ("label1", 30,80,50,20)
$tab1combo=GUICtrlCreateCombo ("", 20,50,60,40)
GUICtrlSetData(-1,"Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
$tab1OK=GUICtrlCreateButton ("OK1", 80,50,50,20)

$tab2=GUICtrlCreateTabitem ("tab2")
GUICtrlSetState(-1,$GUI_SHOW); will be display first
GUICtrlCreateLabel ("label2", 30,80,50,20)
$tab2OK=GUICtrlCreateButton ("OK2", 140,50,50)

; this should disable the OK-button on tab2
GUICtrlSetState($tab2OK , $GUI_DISABLE)

GUICtrlCreateTabitem (""); end tabitem definition

GUICtrlCreateLabel ("label3", 20,130,50,20)

GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites

Since I ran into this yesterday and experimented a bit, I can add just one thing. $GUI_DISABLE does work, however, it seems to now require that the GUI be visible first. If all the GUICtrlSetState() lines are moved after the GUISetState() line, it should work. I do think this is a problem, though, and hope that the old behavior is restored.

Share this post


Link to post
Share on other sites

Since I ran into this yesterday and experimented a bit, I can add just one thing.  $GUI_DISABLE does work, however, it seems to now require that the GUI be visible first.  If all the GUICtrlSetState() lines are moved after the GUISetState() line, it should work.  I do think this is a problem, though, and hope that the old behavior is restored.

<{POST_SNAPBACK}>

@highguy and @Valik will be fix in 3.1.1.45 no need to be visible first will work in both case

Thanks

Share this post


Link to post
Share on other sites

@highguy and @Valik will be fix in 3.1.1.45 no need to be visible first will work in both case

Thanks

<{POST_SNAPBACK}>

Hello jpm,

works fine again now. Thanks a lot! Seems I'm doing quite heavy beta testing at the moment. See this strange behavior with the current release. Looking forward seeing it fixed in the next version. :(

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...