Jump to content

[SOLVED] Can't click on my inputs?


Recommended Posts

Why can I not click on either of my input fields?

#Region ### START Koda GUI section ### Form=
    Global $Form1 = GUICreate("Form1", 730, 437, 192, 124)
    ;GUISetFont(14, 800, 0, "MS Sans Serif")
    GUISetBkColor(0xC0DCC0)
    Global $Label1 = GUICtrlCreateLabel("Enter your Password. UserName is auto filled", 62, 40, 604, 41, $SS_CENTER)
    GUICtrlSetFont(-1, 26, 800, 0, "MS Sans Serif")

    Global $Label2 = GUICtrlCreateLabel("User Name:", 120, 130, 604, 31, $SS_LEFT)
    GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
    Global $Label3 = GUICtrlCreateLabel("Password:", 135, 210, 604, 31, $SS_LEFT)
    GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")

    Global $Input1 = GUICtrlCreateInput(@UserName, 274, 130, 185, 32)
    GUICtrlSetFont(-1, 14, 800, 1, "MS Sans Serif")
    Global $Input2 = GUICtrlCreateInput("Password", 274, 210, 185, 32, $ES_PASSWORD)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    
    Global $OK     = GUICtrlCreateButton("OK", 274, 270, 185, 57)
    GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
    
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit

            Case $OK
                Global $UserName = GUICtrlRead($Input1)
                Global $PassWord = GUICtrlRead($Input2)
                ExitLoop
        EndSwitch
    WEnd

    ; Delete the GUI window
    GUIDelete()

 

Edited by nooneclose
Link to comment
Share on other sites

  • Developers

Your label is much to long and overlapping the input field!
The 640 should be around 135.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>

Global $UserName = @UserName, $PassWord = "Password"

; Scaling :
Global $g_fDPIBase     = 0.96, $g_fDPI = 1 ; scale factor
Global $g_iAppliedDPI = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics", "AppliedDPI")
If Not @error Then
    $g_fDPIBase = $g_iAppliedDPI/100
    $g_fDPI     = Round($g_fDPIBase/$g_iAppliedDPI*100, 2)
EndIf

#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 730, 437, 192, 124)
;GUISetFont(14 * $g_fDPI, 800, 0, "MS Sans Serif")
GUISetBkColor(0xC0DCC0)
Global $Label1 = GUICtrlCreateLabel("Enter your Password. UserName is auto filled", 62, 40, 604, 41, $SS_CENTER)
GUICtrlSetFont(-1, 16 * $g_fDPI, 800, 0, "MS Sans Serif")

Global $Label2 = GUICtrlCreateLabel("Username:", 120, 130, 170, 31, $SS_LEFT)
GUICtrlSetFont(-1, 20 * $g_fDPI, 800, 0, "MS Sans Serif")
Global $Label3 = GUICtrlCreateLabel("Password:", 120, 210, 170, 31, $SS_LEFT)
GUICtrlSetFont(-1, 20 * $g_fDPI, 800, 0, "MS Sans Serif")

Global $Input1 = GUICtrlCreateInput($UserName, 300, 130, 185, 32)
GUICtrlSetFont(-1, 14 * $g_fDPI, 800, 1, "MS Sans Serif")
Global $Input2 = GUICtrlCreateInput($PassWord, 300, 210, 185, 32, $ES_PASSWORD)
GUICtrlSetFont(-1, 14 * $g_fDPI, 800, 0, "MS Sans Serif")

Global $OK = GUICtrlCreateButton("OK", 274, 270, 185, 57)
GUICtrlSetFont(-1, 20 * $g_fDPI, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

        Case $OK
            $UserName = GUICtrlRead($Input1)
            $PassWord = GUICtrlRead($Input2)
            MsgBox(0, "Values", "Username = " & $UserName & @CRLF & "Password = " & $PassWord)
            ExitLoop

    EndSwitch
WEnd

; Delete the GUI window
GUIDelete()

 

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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

×
×
  • Create New...