change image in dialog

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

change image in dialog

Post by pantik » Sat Jan 09, 2010 8:28 am

I need changue the image of my dialog and i have tried include "dialog" command in a loop but it only can be create once. I have tried use "dialog>dialog%k%" in a loop with different k values to create multiples dialogs but this does not work.

Then, i have read this:
[quote="Help for "Dialog""]Image
ImageFile/Data,Left,Top,Width,Height[,name[,result]]
Optional name means images can be changed at run time, e.g.: Let>DialogName.Name=filename.bmp
[/quote]

i have tried this simple code but it dont change the image. How do "optional name" works ?

Code: Select all


Dialog>dialog
Caption=Capture
Width=410
Height=490
Top=CENTER
Left=CENTER
Image=bitmap.bmp,0,0,400,400,name
EndDialog>dialog

Let>k=0
label>loop
add>k,1
Let>dialog.name=%SCRIPT_DIR%\capture%k%.bmp
show>dialog
messagemodal>continue
goto>loop


User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jan 11, 2010 10:18 am

You need to use this with a non-modal dialog and the ResetDialogAction command:

Code: Select all

Dialog>dialog
  Caption=Capture
  Width=410
  Height=490
  Top=CENTER
  Left=CENTER
  Image=bitmap.bmp,0,0,400,400,name
EndDialog>dialog

show>dialog

Let>k=0
label>loop
  add>k,1
  Let>dialog.name=%SCRIPT_DIR%\capture%k%.bmp
  ResetDialogAction>dialog
  messagemodal>continue
goto>loop
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

Post by pantik » Tue Jan 12, 2010 3:29 pm

I already had found the solution but thank you very much.
In other post i post my script.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts