Sign in to follow this  
Followers 0
xXx

Help with Inputs

3 posts in this topic

#1 ·  Posted (edited)

I need help

i want to add a feature to my program that will read hex from an input (here First) and using another input (here Difference) to calculate the hex in the first input to the second input using the difference.

like: i type in difference 0x97A9 and in first input 10 then the second input should show 000097B9 when i click on calc

now: if i change the difference to another hexvalue and click again on calc it wont calculate that with the hexvalue i just typed

here the example code:

#include <GUIConstants.au3>
$Form1 = GUICreate("Test", 176, 97, 192, 125)
$Input1 = GUICtrlCreateInput("", 8, 24, 73, 21, -1, $WS_EX_CLIENTEDGE)
$Input2 = GUICtrlCreateInput("", 8, 64, 73, 21, -1, $WS_EX_CLIENTEDGE)
$Input3 = GUICtrlCreateInput("", 104, 24, 65, 21, -1, $WS_EX_CLIENTEDGE)
$Button1 = GUICtrlCreateButton("Calc", 104, 64, 65, 21, -1 , $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("First", 8, 8, 23, 17)
GUICtrlCreateLabel("Second", 8, 48, 41, 17)
GUICtrlCreateLabel("Difference", 104, 8, 53, 17)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
        
    Case $msg = $Button1
    $read = GUIctrlread($Input1) 
    $hex = Dec($read) + $Input3
    GUIctrlsetdata($Input2,hex($hex,8))
    
    Case Else
        ;;;;;;;
    EndSelect
WEnd
Exit

this may sound very n00bish but i really cant get that to work

i would like if someone of you can help me

Edited by xXx

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

i knew i forgot something... thx for your fast help

Edited by xXx

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