Jump to content

needing help with GUICtrlCreateInput


Recommended Posts

Ok here it is I'm Back. :(

This is what I am needing to do. Set up 10 input boxes in a window. Write all the values to an ini file. All inputs have different keys.

I thought i was on the right track until I looked at the ini file it created. Keeps returning a value of "3" :)

It doesn't matter what I type into the boxes. once i click save it writes a value of 3 to the ini.

And here i thought i would make it 24 hrs without having to post on here. :)

I will keep working on it and checking back here also.

any and all ideas are appreciated. Thx from Cue

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $Button_1, $msg, $test1
    
    
    GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered
    $test1 = GUICtrlCreateInput("Test", 10, 5, 300, 20)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    GUICtrlCreateInput("", 10, 35, 300, 20)     ;   
        
    $Button_1 = GUICtrlCreateButton("save", 10, 100, 100)
    
    GUISetState()      ; will display an  dialog box with 1 button

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
                IniWrite("C:\Users\Main\Desktop\test.ini", "script test","test1", $test1)    ; Will write to ini file
        exit
                
        EndSelect
    WEnd
EndFunc   ;==>Example
Link to comment
Share on other sites

Valuater,

thx, that did the trick. I just couldn't figure out how write and read in the same line would work together. Guessing i need to start thinking about this stuff in a different way.

Appreciate your help.

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...