Jump to content

Input Box with multiple Inputs?


 Share

Recommended Posts

Hi,

I want to make an Input Box, with for exelmple

Username: *Enter Username*

Password: *Enter Password*

But when i use the InputBox Command, there is always only 1 Input Box :P.

Is there another way without creating a GUI?

thank you for your help :lmao:

Link to comment
Share on other sites

  • Moderators

There's not a way with an input box to have 2 input fields with a single input box.

However, you could simply use the newest beta, look at my signature, and use the "Koda" tool to make a GUI to accomplish this.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Because i dont really know how =)

Here is a quick example from Koda

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("Input Details", 162, 108, 440, 166)
$Input1 = GUICtrlCreateInput("AInput1", 32, 24, 97, 21, -1, $WS_EX_CLIENTEDGE)
$Input2 = GUICtrlCreateInput("AInput2", 32, 80, 97, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Username", 40, 0, 75, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("Password", 40, 56, 72, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd
Exit


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

HA!! BIG DOD!!, I had decided to help out too!

#include <GUICONSTANTS.AU3>
$MAIN = GUICreate("USERNAME & PASSWORD", 220, 120)
GUICtrlCreateLabel("USERNAME:", 10, 15, 65, 25)
$USERNAME = GUICtrlCreateInput("", 80, 10, 120, 25)
GUICtrlCreateLabel("PASSWORD:", 10, 55, 65, 25)
$PASSWORD = GUICtrlCreateInput("", 80, 50, 120, 25)
$OK = GUICtrlCreateButton("OK", 40, 85, 60, 25)
$CANCEL = GUICtrlCreateButton("CANCEL", 120, 85, 60, 25)

GUISetState()
While 1
    $MSG = GUIGetMsg()
    Select
    Case $MSG = $GUI_EVENT_CLOSE Or $MSG = $CANCEL
        Exit
    Case $MSG = $OK
        If GUICtrlRead($USERNAME) = "SOMETHING CORRECT" And GUICtrlRead($PASSWORD) = "CORRECT TO THE USERNAME" Then
            GUIDelete($MAIN)
        ;WHATEVER YOUR GOING TO DO
        Else
            MsgBox(0, "ERROR", "HEY, CHECK YOUR DIGITS!!, YOU MESSED UP")
        EndIf
    EndSelect
    Sleep(10)
WEnd

By the way, your probably going to have to learn a bit about .ini files sd33221.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...