Sign in to follow this  
Followers 0
drak

What's wrong

5 posts in this topic

I have a dialog box with a TAB control & 2 tabs on it, the first OK button on TAB0 doesn't work eg: can't click on it - here's the code, TIA

GUICreate("User Manager", 220, 220, -1, -1, $WS_EX_DLGMODALFRAME)
$TAB = GUICtrlCreateTab (0, 0, 220, 220)

$TAB0 = GUICtrlCreateTabitem ("Unlock Account")
GuiCtrlCreateLabel ("User ID:", 10, 35, 95)
$USERID0 = GUICtrlCreateInput ("", 100, 35, 80, 20)
GuiCtrlCreateLabel ("Server:", 10, 60, 95)
$SERVER0 = GUICtrlCreateInput ("", 100, 60, 80, 20)
$EXIT0 = GUICtrlCreateButton ("Exit", 120, 140);, 50)
$UNLOK0 = GUICtrlCreateButton ("Ok", 10, 140);, 50)
GUICtrlSetState(-1,$GUI_FOCUS)

$TAB1 = GUICtrlCreateTabitem ("Change Password")
GuiCtrlCreateLabel ("User ID:", 10, 35, 95)
$USERID1 = GUICtrlCreateInput ("", 100, 35, 80, 20)
GuiCtrlCreateLabel ("Server:", 10, 60, 95)
$SERVER1 = GUICtrlCreateInput ("", 100, 60, 80, 20)
GuiCtrlCreateLabel ("New Password:", 10, 85, 95)
$NEWPASS1 = GUICtrlCreateInput ("", 100, 85, 80, 20, $ES_PASSWORD)
GuiCtrlCreateLabel ("Confirm Password:", 10, 110, 95)
$CONPASS1 = GUICtrlCreateInput ("", 100, 110, 80, 20, $ES_PASSWORD)
$CPWOK1 = GUICtrlCreateButton ("Ok", 10, 140);, 50)
GUICtrlSetState(-1,$GUI_FOCUS)
$EXIT1 = GUICtrlCreateButton ("Exit", 120, 140);, 50)

GuiSetState ()

While 1
   $MSG = GUIGetMsg()
   
   Select
      Case $MSG = $UNLOK0
         If GUIRead($USERID0) > "" Then
            MsgBox(4096, "User ID", "No User ID")
            ContinueLoop
         EndIf
         If GUIRead($SERVER0) > "" Then
            MsgBox(4096, "Server ID", "No Server ID")
            ContinueLoop
         EndIf

      Case $MSG = $EXIT0
         Exit

      Case $MSG = $CPWOK1
         If GUIRead($USERID1) > "" Then
            MsgBox(4096, "User ID", "No User ID")
            ContinueLoop
         EndIf
         If GUIRead($SERVER1) > "" Then
            MsgBox(4096, "Server ID", "No Server ID")
            ContinueLoop
         EndIf
         
      Case $MSG = $EXIT1
         Exit
   EndSelect
Wend

there's still abit of code to write but I like to get rid of bugs as I go, thx

Share this post


Link to post
Share on other sites



thx Larry just a little typo on my part but that did not fix the issue with the Ok button

the first OK button can't be clicked, it's like it's disabled but not grayed out

Share this post


Link to post
Share on other sites

thx again Larry but removing that from my code has not fixed the problem

while replying to this I Found the problem :)

$TAB = GUICtrlCreateTab (0, 0, 220, 220)

GuiCtrlCreateLabel("User ID:", 10, 35, 95)

from the Help file for Labels

[height] The height of the control (default is the previous used height).

my Labels where covering the button but in a way that allowed me to see the button but not use it ;)

so I'm going to put a height value on my labels from now on :)

Share this post


Link to post
Share on other sites

Well on my Win2K the window was all screwed, perhaps cause I am stuck at 256 colors, but removing the WS_EX thing it got fixed... just some info to consider...

Lar.

<{POST_SNAPBACK}>

thx, Larry

All my users are on XP, may have to run it on W2K just to see the results :)

Share this post


Link to post
Share on other sites

The default label height is too big and it overlapped the button.

Here's a working version.

#include <GUIConstants.au3>
AutoItSetOption("TrayIconDebug", 1)

GUICreate("User Manager", 220, 220, -1, -1, $WS_EX_DLGMODALFRAME)

$TAB = GUICtrlCreateTab (0, 0, 220, 220)

$TAB0 = GUICtrlCreateTabitem ("Unlock Account")
GuiCtrlCreateLabel ("User ID:", 10, 35, 95, 15)
$USERID0 = GUICtrlCreateInput ("", 100, 35, 80, 20)
GuiCtrlCreateLabel ("Server:", 10, 60, 95, 15)
$SERVER0 = GUICtrlCreateInput ("", 100, 60, 80, 20)
$EXIT0 = GUICtrlCreateButton ("Exit", 120, 140);, 50)
$UNLOK0 = GUICtrlCreateButton ("Ok", 10, 140);, 50)
GUICtrlSetState(-1,$GUI_FOCUS)

$TAB1 = GUICtrlCreateTabitem ("Change Password")
GuiCtrlCreateLabel ("User ID:", 10, 35, 95, 15)
$USERID1 = GUICtrlCreateInput ("", 100, 35, 80, 20)
GuiCtrlCreateLabel ("Server:", 10, 60, 95, 15)
$SERVER1 = GUICtrlCreateInput ("", 100, 60, 80, 20)
GuiCtrlCreateLabel ("New Password:", 10, 85, 95, 15)
$NEWPASS1 = GUICtrlCreateInput ("", 100, 85, 80, 20, $ES_PASSWORD)
GuiCtrlCreateLabel ("Confirm Password:", 10, 110, 95, 15)
$CONPASS1 = GUICtrlCreateInput ("", 100, 110, 80, 20, $ES_PASSWORD)
$CPWOK1 = GUICtrlCreateButton ("Ok", 10, 140);, 50)
GUICtrlSetState(-1,$GUI_FOCUS)
$EXIT1 = GUICtrlCreateButton ("Exit", 120, 140);, 50)

GuiSetState ()

While 1
  $MSG = GUIGetMsg()
 
  Select
     Case $MSG = $UNLOK0
        If GUIRead($USERID0) > "" Then
           MsgBox(4096, "User ID", "No User ID")
           ContinueLoop
        EndIf
        If GUIRead($SERVER0) > "" Then
           MsgBox(4096, "Server ID", "No Server ID")
           ContinueLoop
        EndIf

     Case $MSG = $EXIT0
        Exit

     Case $MSG = $CPWOK1
        If GUIRead($USERID1) > "" Then
           MsgBox(4096, "User ID", "No User ID")
           ContinueLoop
        EndIf
        If GUIRead($SERVER1) > "" Then
           MsgBox(4096, "Server ID", "No Server ID")
           ContinueLoop
        EndIf
       
     Case $MSG = $EXIT1
        Exit
  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