Jump to content
George__

GUI Input

Recommended Posts

George__

I have made a GUI where you can click from a drop-down menu 12 options (months). I want the option selected to look for a image using ImageSearch and I cant seem to find what is wrong this is what I have so far.

$month = GUICtrlCreateCombo("", 100, 72)
GUICtrlSetData(-1, "01|02|03|04|05|06|07|08|09|10|11|12", "01")

            $month = GUICtrlRead($month)

            Local $search = _ImageSearch('images/month', $month,'.bmp',0, $x, $y, 0)

I also have the basic GUI code just don't believe its relevant.

Thanks 

Share this post


Link to post
Share on other sites
InunoTaishou

I can't seem to find what's wrong with it either, I have no way to replicate the issue. The only thing I see wrong out of this so far is

$month = GUICtrlRead($month)

$month is no longer the control id for your combo box

Local $search = _ImageSearch('images/month', $month,'.bmp',0, $x, $y, 0)

'images/month' is argument one, $month is argument two, '.bmp' is argument 3, 0 is argument 4, $x is argument 5, $y is argument 6, and 0 is argument 7. I don't know how your _ImageSearch function looks and what the parameters are to use it.

Share this post


Link to post
Share on other sites
George__

Is there a way i can include the $month without having to inter fear with the parameters? 

Share this post


Link to post
Share on other sites
George__

I think I have a solution what I saw on a thread earlier which I can no longer find how can I keep what 

GUICtrlSetData(-1, "01|02|03|04|05|06|07|08|09|10|11|12", "01")

Displays but change 01 for example to = images/month01.bmp

 

Share this post


Link to post
Share on other sites
InunoTaishou
Local $image_search_result = _ImageSearch("images/month" & GUICtrlRead($month) & ".bmp, 0, $x, $y, 0)

Will do what you originally wanted.

GUICtrlsetData(-1, "images/month01.bmp|images/month02.bmp|images/month03.bmp|etc", "images/month01.bmp")

Will do what you want based on your last post.

Edited by InunoTaishou

Share this post


Link to post
Share on other sites
George__

Thanks alot InunoTaishou

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

×