Sign in to follow this  
Followers 0
BubbleGumDancer

gui nightmare

what did you get for christmiss?   2 members have voted

  1. 1. what did you get for christmiss?

    • money
    • cloths/pants/shirts
      0
    • socks
      0
    • rock
      0
    • books
      0
    • a yummie.....bj............giftcard...YOU TRICKED ME!!!
      0
    • empty present -nothing inside ;(
      0
    • car keys - woooo
      0
    • dont remember passed out from eggknog
      0
    • an item you cant use - why did you give me paddle when i dont have a boat awwww
      0
    • maid for a week
      0
    • pinecone
      0
    • bottle of kattie parrys breath :( or :)
      0
    • gold?
      0
    • Anthracite coal in red sock - yessssssss

Please sign in or register to vote in this poll.

2 posts in this topic

I'm trying to make a gui of a mass of buttons so when I click on a button it will launch an emial / that part the ie lauch is easy but the gui starts lauching ie windows when it loads. It should be button click = run function not run gui and a mess of functions run with out me clicking on the buttons :x

passwords are crypted and decrypted then send to the window but thats in another script the gui is failing me ;(

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <Crypt.au3>
Opt('MustDeclareVars', 1)
AutoItSetOption("MouseCoordmode", 0)

$file = FileOpen("settings.ini", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileClose($file)


main ()
;decrypt ()
;send ()

Func main ()
Local $Button_1, $Button_2, $msg, $Button_3, $Button_4,$Button_5,$Button_6, $Username, $Password, $Button_7
Local $Button_8, $Button_9, $Button_10, $Button_11, $Button_12, $Button_13, $Button_14, $Button_15, $Button_16, $Button_17
Local $Button_18, $Button_19, $Button_20, $Button_21, $Button_22, $Button_23, $Button_24, $Button_25, $Button_26, $Button_27
Local $Button_28, $Button_29, $Button_30, $Button_31, $Button_32, $Button_33, $Button_34, $Button_35, $Button_36, $Button_37
Local $Button_38, $Button_39, $Button_40, $Button_41, $Button_42, $Button_43, $Button_44
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Unguidedone's Account Management System", 623, 442, 192, 124)
$Button1 = GUICtrlCreateButton("account 1", 16, 16, 81, 25)
$Button2 = GUICtrlCreateButton("account 2", 16, 56, 81, 25)
$Button3 = GUICtrlCreateButton("account 3", 16, 96, 81, 25)
$Button4 = GUICtrlCreateButton("account 4", 16, 144, 81, 25)
$Button5 = GUICtrlCreateButton("account 5", 16, 184, 81, 25)
$Button6 = GUICtrlCreateButton("account 6", 16, 224, 81, 25)
$Button7 = GUICtrlCreateButton("account 7", 16, 272, 81, 25)
$Button8 = GUICtrlCreateButton("account 8", 16, 312, 81, 25)
$Button9 = GUICtrlCreateButton("account 9", 16, 352, 81, 25)
$Button10 = GUICtrlCreateButton("account 10", 16, 400, 81, 25)
$Button11 = GUICtrlCreateButton("account 11", 112, 16, 81, 25)
$Button12 = GUICtrlCreateButton("account 12", 112, 56, 81, 25)
$Button13 = GUICtrlCreateButton("account 13", 112, 104, 81, 25)
$Button14 = GUICtrlCreateButton("account 14", 112, 144, 81, 25)
$Button15 = GUICtrlCreateButton("account 15", 104, 184, 81, 25)
$Button16 = GUICtrlCreateButton("account 16", 112, 232, 81, 25)
$Button17 = GUICtrlCreateButton("account 17", 112, 272, 81, 25)
$Button18 = GUICtrlCreateButton("account 18", 112, 312, 81, 25)
$Button19 = GUICtrlCreateButton("account 19", 112, 360, 81, 25)
$Button20 = GUICtrlCreateButton("account 20", 112, 400, 81, 25)
$Button21 = GUICtrlCreateButton("account 21", 208, 16, 81, 25)
$Button22 = GUICtrlCreateButton("account 22", 208, 56, 81, 25)
$Button23 = GUICtrlCreateButton("account 23", 208, 104, 81, 25)
$Button24 = GUICtrlCreateButton("account 24", 208, 144, 81, 25)
$Button25 = GUICtrlCreateButton("account 25", 200, 184, 81, 25)
$Button26 = GUICtrlCreateButton("account 26", 200, 232, 81, 25)
$Button27 = GUICtrlCreateButton("account 27", 208, 280, 81, 25)
$Button28 = GUICtrlCreateButton("account 28", 208, 320, 81, 25)
$Button29 = GUICtrlCreateButton("account 29", 208, 360, 81, 25)
$Button30 = GUICtrlCreateButton("account 30", 208, 400, 81, 25)
$Button31 = GUICtrlCreateButton("account 31", 296, 16, 81, 25)
$Button32 = GUICtrlCreateButton("account 32", 296, 59, 81, 25)
$Button33 = GUICtrlCreateButton("account 33", 304, 101, 81, 25)
$Button34 = GUICtrlCreateButton("account 34", 304, 144, 81, 25)
$Button35 = GUICtrlCreateButton("account 35", 296, 187, 81, 25)
$Button36 = GUICtrlCreateButton("account 36", 296, 229, 81, 25)
$Button37 = GUICtrlCreateButton("account 37", 296, 272, 81, 25)
$Button38 = GUICtrlCreateButton("account 38", 296, 315, 81, 25)
$Button39 = GUICtrlCreateButton("account 39", 304, 357, 81, 25)
$Button40 = GUICtrlCreateButton("account 40", 296, 400, 81, 25)
$Button41 = GUICtrlCreateButton("Main email Account", 448, 24, 169, 81)
$Button42 = GUICtrlCreateButton("Main seconday email Account", 445, 129, 169, 81)
$Button43 = GUICtrlCreateButton("Main third email Account", 442, 229, 169, 81)
$Button44 = GUICtrlCreateButton("Main forth email Account", 441, 333, 169, 81)
$Edit1 = GUICtrlCreateEdit("", 24, 40, 17, 1)
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



 While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
                MsgBox(0, 'Testing', 'Button 1 was pressed') 
            Case $msg = $Button_2
                
            Case $msg = $Button_3
            
            Case $msg = $Button_4
            
            Case $msg = $Button_5
            
            Case $msg = $Button_6
            
            Case $msg = $Button_7
            
            Case $msg = $Button_8
            
            Case $msg = $Button_9
            
            Case $msg = $Button_10
            
            Case $msg = $Button_11
            
            Case $msg = $Button_12
            
            Case $msg = $Button_13
            
            Case $msg = $Button_14
            
            Case $msg = $Button_15
                
            Case $msg = $Button_16
            
            Case $msg = $Button_17
            
            Case $msg = $Button_18
            
            Case $msg = $Button_19
            
            Case $msg = $Button_29
            
            Case $msg = $Button_21
            
            Case $msg = $Button_22
            
            Case $msg = $Button_23
            
            Case $msg = $Button_24
            
            Case $msg = $Button_25
            
            Case $msg = $Button_26
            
            Case $msg = $Button_27
            
            Case $msg = $Button_28
                
            Case $msg = $Button_29
            
            Case $msg = $Button_30
            
            Case $msg = $Button_31
            
            Case $msg = $Button_32
            
            Case $msg = $Button_33
            
            Case $msg = $Button_34
            
            Case $msg = $Button_35
            
            Case $msg = $Button_36
            
            Case $msg = $Button_37
            
            Case $msg = $Button_38
            
            Case $msg = $Button_39
            
            Case $msg = $Button_40
               
            Case $msg = $Button_41
            fastlogin ()
            Case $msg = $Button_42
            
            Case $msg = $Button_43
            
            Case $msg = $Button_44
            
        EndSelect
    WEnd
EndFunc

If you were twice as smart, you'd still be stupid.

Share this post


Link to post
Share on other sites



BubbleGumDancer,

The functions are firing because you are using undefined variables in the GUIGetMsg loop. :P

You have declared and are checking:

$Button_1, $Button_2, $msg, $Button_3

but you create:

Button1 = GUICtrlCreateButton(
Button2 = GUICtrlCreateButton(
Button3 = GUICtrlCreateButton(

Notice the difference? :x

Top Tip: If you find functions in a GUIGetMsg loop firing all the time - check you do not have an undefined variable being checked. If you do have one, the relevant Case will always fire on a return of 0, which is what you get from GUIGetMsg when nothing is happening. :shifty:

M23

P.S. I would look into using an array to hold the button ControlIds - it would make your code a great deal shorter. :nuke:


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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