Sign in to follow this  
Followers 0
Hansio

GUICtrlRead, or what?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



It shoud be

If GuiCtrlRead($Key1) = "<none>" Then ...

ElseIf GuiCtrlRead($Key1) = "Alt +" Then... and so on

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thank you both

Share this post


Link to post
Share on other sites

You bet. Good luck with your project.


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

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