Jump to content

how to change multiple images in gui.


Natas70
 Share

Recommended Posts

Please forgive my Noobness, even tho I have been around autoit for sometime, I don't try to create code unless i have an idea. I also am a "for fun programmer" I am not a professional.

I am trying to create a sudoku game board in a gui, using tile like images for the numbers. I used

$Pic1 = GUICtrlCreatePic

. . . .

$Pic81 = GUICtrlCreatePic

to create the 81 possible tile locations. I want to be able to highlight a block, row and or column if a number is present. so I thought i could do

$cursor = "$pic" & $bpos [$row] [$col]

$image = "F:\Program Files (x86)\My Autoit\Autoit projects\sudoku nov\soduko buttons\tile.jpg"

guictrlsetimage($cursor, $image)

GUISetState()

the $bpos [$row] [$col] holds the control id for that row/col location. this is not working but if i do the following it will work i would like to not have to do this line for each time i want to highlight a row/col/block that contains the number i am searching for. it seems more efficient to do it in a loop incrementing the row and column.

$image = "F:\Program Files (x86)\My Autoit\Autoit projects\sudoku nov\soduko buttons\tile.jpg"

guictrlsetimage($pic74, $image)

GUISetState()

my question is can or how you change a control by storing the id in a variable?

Thanx in advance, I tried to search for this, but really didn't know the correct question or keywords to use, i tried control id and variable, etc. I appreciate any feedback you can share.

James

Link to comment
Share on other sites

I think i might have figured it out. I was trying to create the handle? $pic74 and for some reason it would not work in a variable. but i recreated the bpos array using the autoit window info tool to get the correct id and stored that number and it is working now.

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