recreate bitmap control at runtime (OpenInsight 32-bit Specific)
At 12 APR 2002 03:33:04PM John A King wrote:
We are trying to assign a BMP file to a bitmap control at runtime.
Here is the code we have in form`s create event:
DECLARE FUNCTION SET_PROPERTY, GET_PROPERTY, MSG
DECLARE SUBROUTINE UTILITY
$INSERT PS_EQUATES
STRUCT=GET_PROPERTY("BITMAP_1","ORIG_STRUCT")
UTILITY("DESTROY","BITMAP_1")
UTILITY("CREATE", STRUCT)
a=SET_PROPERTY("BITMAP_1", "BITMAP", "C:\DISK\IMAGE.BMP")
This code neither destroys nor creates the control. Can someone help us find an error?
John
At 12 APR 2002 04:07PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
John,
You need to fully qualify the BITMAP control name by prefixing it with the window name.
So if your window was called 'TEST' for example then you would use 'TEST.BITMAP1' in your code ( or @window : ".BITMAP_1" )
World leaders in all things RevSoft
At 12 APR 2002 04:34PM Oystein Reigem wrote:
John,
A simple Set_Property does it for me. No DESTROY and CREATE necessary.
(And I'd recommend you use @Window and not hard-coded window names ("TEST") in your programming (see Sprezz's advice). So much easier if you want to change the name of your window. Or base another window on the first one. Saves you from a lot of program changes.)
- Oystein -
At 12 APR 2002 06:42PM Don Miller - C3 Inc. wrote:
Oystein ..
That is exactly what we do. We have a large pushbutton on the launch for our app that has a picture bitmap on it. If the user clicks the picture, it changes to another picture and swaps the current database files for tutorial files to allow for on-line trial of whatever they are interested in doing. They can click the picture again to return to their live database.
We just use a user-defined @variable to indicate which state the system is in (normal or tutorial) and do simple Set_Property calls to swap the pictures and attach the database.
Don