Sign in to follow this  
Followers 0
eekhoorn12

Picture doesn't change

4 posts in this topic

Why doesn't the pictute changes to the green one

#include <GUIConstants.au3>

$Fout = "roderondje.gif"

;Hier wordt de gui gecreerd
GUICreate ( "QueueIt" , 650 , 400 ) ; will create a dialog box that when displayed is centered

$TITLE4 = GUICtrlCreateInput("", 15, 225, 100, 20, $ES_READONLY+$WS_EX_STATICEDGE+$ES_NUMBER)
$TITLE4A = GuiCtrlCreateUpDown(-1)
GUICtrlSetLimit($TITLE4A, 100, 0)

$groen = GUICtrlCreatePic ( $Fout, 500, 150, 20, 20)

GUISetState (@SW_SHOW)
While 1
    if GUICtrlRead($TITLE4) == 10 then
    $Fout = "groenrondje.gif"
    endif
Wend

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

maybe this

While 1
    if GUICtrlRead($TITLE4) == 10 then
    GUICtrlSetImage($groen,  "groenrondje.gif"); needs the proper location - C:\temp\temp.pic
;$Fout = "groenrondje.gif"
    endif
Sleep(10)
Wend

i am not sure "gif" is supported

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Well it seems to work even with a .gif

Thanks

Edited by eekhoorn12

Share this post


Link to post
Share on other sites

Now i want the code to change te picture if a sting contains a certain character. I've already got that when te last letter is " that it turns green but when i typ another letter it turns red again what do i do wrong.

#include <GUIConstants.au3>

$Fout = "roderondje.gif"


GUICreate ( "QueueIt" , 650 , 400 )  

$TITLE2 = GUICtrlCreateInput("", 15, 40, 100, 20)
$groen = GUICtrlCreatePic ( $Fout, 500, 150, 20, 20)
$s_Result = 0
$q = 0
GUISetState (@SW_SHOW)
While 1
    $z = StringLen($s_Result)
    $s_Result = GUICtrlRead($TITLE2)
       For $x = 1 to StringLen($s_Result)
    $i = StringMid($s_Result,$x,1)
    $a = Asc ($i)
    
    If $a = 34 and $z <> StringLen($s_Result) Then
    
    
    GUICtrlSetImage($groen,  "groenrondje.gif")
    $q = 1
    elseif $a <> 34 and $z <> StringLen($s_Result) then
    GUICtrlSetImage($groen,  "roderondje.gif")
    $q = 0
    endif
    next
Sleep(10)
Wend

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