nooneclose Posted June 19, 2020 Posted June 19, 2020 (edited) Why can I not click on either of my input fields? expandcollapse popup#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 June 22, 2020 by nooneclose
Developers Jos Posted June 19, 2020 Developers Posted June 19, 2020 (edited) Your label is much to long and overlapping the input field! The 640 should be around 135. Edited June 19, 2020 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.
Musashi Posted June 19, 2020 Posted June 19, 2020 (edited) expandcollapse popup#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 June 19, 2020 by Musashi "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
nooneclose Posted June 22, 2020 Author Posted June 22, 2020 @Jos and @Musashi Thank you for your help. I changed the label lengths and it works fine.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now