Jump to content

GUICtrlRead, or what?


Hansio
 Share

Recommended Posts

I can not get my code to write to my ini file. Should I use GUICtrlRead

$Key1=GUICtrlCreateCombo("", 130, 10, 70, 120)
GUICtrlSetData(-1, "<none>|Alt +|Ctrl +|Shift +", "<none>")
 
 
 
If $Key1="<none>" Then
IniWrite(@Scriptdir & "\config.ini", "section", "Tester 2", GUICtrlRead(""))
ElseIf $Key1="Alt +" Then
IniWrite(@Scriptdir & "\config.ini", "section", "Tester 2", GUICtrlRead("!"))
Elseif $Key1="Ctrl +" Then
IniWrite(@Scriptdir & "\config.ini", "section", "Tester 2", GUICtrlRead("^"))
ElseIf $Key1="Shift +" Then
IniWrite(@Scriptdir & "\config.ini", "section", "Tester 2", GUICtrlRead("+"))
EndIf
Link to comment
Share on other sites

I have found Switch to be useful for reading out of GUICtrlCreateCombo(), easier to read anyway..

Switch GuiCtrlRead($Key1)
 Case "<none>"
   ; code here
 Case "Alt +"
   ;code here
 Case "Ctrl +"
   ;code here
 Case "Shift +"
  ;code here
EndSwitch

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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