I have a dialog which pulls data from Access and displays the data in the dialog. Part of that data consists of 5 image files. I then allow the user to change the key search criteria, which should retrieve ALL new details. For some reason, everything refreshes BUT the image files.
I am using variables to store the names of the image files.
All image files are in the same directory.
The debugger shows that the value in the image variable is correct (but still displays the previous file)
I have not found this issue in any of the forums. I could post an example of the code, but it is quite large.
Refresh Image files in a Dialog
Moderators: JRL, Dorian (MJT support)
Paul,
Some of the dialog settings once set are permanent. Width, height, top, left, caption are all fixed once you've defined the dialog. Apparently this is also true for the button and background images. Try something like this instead:
Hope this helps,
Dick
Edited for future references. Added If file exists, delete file. To remove file in the event of a script crash leaving the file behind.
Some of the dialog settings once set are permanent. Width, height, top, left, caption are all fixed once you've defined the dialog. Apparently this is also true for the button and background images. Try something like this instead:
Hope this helps,
Dick
Edited for future references. Added If file exists, delete file. To remove file in the event of a script crash leaving the file behind.
Code: Select all
IfFileExists>c:\~dialogbmptest~.scp
DeleteFile>c:\~dialogbmptest~.scp
EndIf
Let>k=0
Let>BMPfile=
Label>start
Add>k,1
WriteLn>c:\~dialogbmptest~.scp,wr,Dialog>Dialog%k%
WriteLn>c:\~dialogbmptest~.scp,wr, Caption=View BMP number %k%
WriteLn>c:\~dialogbmptest~.scp,wr, Width=347
WriteLn>c:\~dialogbmptest~.scp,wr, Height=300
WriteLn>c:\~dialogbmptest~.scp,wr, Top=180
WriteLn>c:\~dialogbmptest~.scp,wr, Left=322
WriteLn>c:\~dialogbmptest~.scp,wr, Button=OK,8,232,75,25,3
WriteLn>c:\~dialogbmptest~.scp,wr, Button=Cancel,256,232,75,25,2
WriteLn>c:\~dialogbmptest~.scp,wr, Edit=msEdit1,8,160,321,
WriteLn>c:\~dialogbmptest~.scp,wr, Button= ,24,24,289,121,4,%BMPfile%
WriteLn>c:\~dialogbmptest~.scp,wr, Button=Browse,8,192,75,25,4
WriteLn>c:\~dialogbmptest~.scp,wr, FileBrowse=Browse,msEdit1,BMP files|*.bmp
WriteLn>c:\~dialogbmptest~.scp,wr,EndDialog>Dialog%k%
WriteLn>c:\~dialogbmptest~.scp,wr,Show>Dialog%k%,r%k%
WriteLn>c:\~dialogbmptest~.scp,wr,If>r%k%=2,finish
WriteLn>c:\~dialogbmptest~.scp,wr,If>r%k%=3
WriteLn>c:\~dialogbmptest~.scp,wr, //dosomething
WriteLn>c:\~dialogbmptest~.scp,wr,Goto>continue
WriteLn>c:\~dialogbmptest~.scp,wr,Else
WriteLn>c:\~dialogbmptest~.scp,wr, Let>MACRO_RESULT=Dialog%k%.msEdit1
WriteLn>c:\~dialogbmptest~.scp,wr,Goto>continue
WriteLn>c:\~dialogbmptest~.scp,wr,EndIf
WriteLn>c:\~dialogbmptest~.scp,wr,Label>finish
WriteLn>c:\~dialogbmptest~.scp,wr,Let>MACRO_RESULT=finish
WriteLn>c:\~dialogbmptest~.scp,wr,Label>continue
Macro>c:\~dialogbmptest~.scp
DeleteFile>c:\~dialogbmptest~.scp
If>%MACRO_RESULT%=finish,quit
Let>BMPfile=%MACRO_RESULT%
Goto>start
Label>quit
Last edited by JRL on Thu Jun 22, 2006 8:49 pm, edited 1 time in total.