Sign in to follow this  
Followers 0
FMS

filling in a GUI in whit less text.

3 posts in this topic

#1 ·  Posted (edited)

Hello reader,

Here i got 2 GUI scripts :)

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

Global $aCheckbox[5]
Global $aInput[5][2]

$hGUI = GUICreate("Password Changer", 480, 480)

For $i = 1 To 4
    GUICtrlCreateGroup("Application " & $i & " - Current PW", 10, (70 * $i) - 60, 460, 70)
    $aCheckbox[$i] = GUICtrlCreateCheckbox("Change PW", 20, (70 * $i) - 40, 100, 20)
    $aInput[$i][0] = GUICtrlCreateInput("", 150, (70 * $i) - 50, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
    $aInput[$i][1] = GUICtrlCreateInput("", 150, (70 * $i) - 20, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))

Next

GUICtrlCreateGroup("New Password", 10, 320, 460, 130)
$aInput[0][0] = GUICtrlCreateInput("", 100, 330, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
$aInput[0][1] = GUICtrlCreateInput("", 100, 360, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("Cancel", 140, 400, 80, 30)
$Button2 = GUICtrlCreateButton("Change", 260, 400, 80, 30)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form2 = GUICreate("GUI control", 481, 472, 186, 112)
$Input1 = GUICtrlCreateInput("", 248, 40, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Checkbox1 = GUICtrlCreateCheckbox("prog 1", 40, 48, 105, 17)
$Input2 = GUICtrlCreateInput("", 248, 72, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Checkbox2 = GUICtrlCreateCheckbox("Prog 2", 40, 112, 105, 17)
$Input3 = GUICtrlCreateInput("", 248, 104, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Input4 = GUICtrlCreateInput("", 248, 136, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Checkbox3 = GUICtrlCreateCheckbox("Prog 3", 40, 176, 105, 17)
$Input5 = GUICtrlCreateInput("", 248, 168, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Input6 = GUICtrlCreateInput("", 248, 200, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Checkbox4 = GUICtrlCreateCheckbox("Prog 4", 40, 240, 105, 17)
$Input7 = GUICtrlCreateInput("", 248, 232, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Input8 = GUICtrlCreateInput("", 248, 264, 193, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Input9 = GUICtrlCreateInput("", 104, 336, 241, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("OK", 232, 408, 97, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Cancel", 120, 408, 89, 25, $WS_GROUP)
$Group1 = GUICtrlCreateGroup("Group 1", 16, 16, 193, 297)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Group 2", 232, 16, 225, 297)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input10 = GUICtrlCreateInput("", 104, 368, 241, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Group3 = GUICtrlCreateGroup("Group 3", 16, 320, 441, 129)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

As u c :) 2 of the (almost) same GUI's but in the first i cant change to diffrent names that i like.(-->GUICtrlCreateGroup("Application " & $i & )

In the second i can, other wise all is changed in the same....

Does anyone know iff i can in the first script also change the names to diffrent names,

instead only in application for all???

Greez from FMS

Edited by FMS

as finishing touch god created the dutch

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello.

Maybe you should use an another array with the names?

Here is small example:

$aArray[0]="Program 1"
$aArray[1]="Program 2"
$aArray[2]="Program 3"
$aArray[3]="Program 4"
For $sAppName In $aArray
    For $i = 1 To 4
        GUICtrlCreateGroup($sAppName, 10, (70 * $i) - 60, 460, 70)
        $aCheckbox[$i] = GUICtrlCreateCheckbox("Change PW", 20, (70 * $i) - 40, 100, 20)
        $aInput[$i][0] = GUICtrlCreateInput("", 150, (70 * $i) - 50, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
        $aInput[$i][1] = GUICtrlCreateInput("", 150, (70 * $i) - 20, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
    Next
Next

Edit: I enjoy that you're found a right solution =)

Edited by Crystall

Hello World!

Share this post


Link to post
Share on other sites

Global $aCheckbox[5]
Global $aInput[5][2]
Global $aArray[5]
$hGUI = GUICreate("GUI hello world", 480, 480)

$aArray[1]="0000"
$aArray[2]="1111"
$aArray[3]="***"
$aArray[4]="***"


For $i = 1 To 4
    GUICtrlCreateGroup($aArray[$i], 10, (70 * $i) - 60, 460, 70)
    $aCheckbox[$i] = GUICtrlCreateCheckbox("Change PW", 20, (70 * $i) - 40, 100, 20)
    $aInput[$i][0] = GUICtrlCreateInput("", 150, (70 * $i) - 50, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
    $aInput[$i][1] = GUICtrlCreateInput("", 150, (70 * $i) - 20, 300, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
Next

Thnx for the tip :)

this did the trick :)

gr.

FMS


as finishing touch god created the dutch

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