Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

image button

How to load image in CNiButton button in vc 6 measurement

studio at run time.
0 Kudos
Message 1 of 4
(7,165 Views)
Hi Khoja,
 
You can set the image by the following function calls:
 
 [var name].OffImages(5).Url = "[your image.bmp]";
 [var name].OffImages(5).SaveLink;
 [var name].OffImages(5).Reload();
 
You can also set OnImages similarly. 
Cheers,

David Goldberg
National Instruments
Software R&D
0 Kudos
Message 2 of 4
(7,144 Views)
Thanks for reply but
I got following error
d:\imagebutton\imagebuttondlg.cpp(121) : error C2664: 'OnImages' : cannot convert parameter 1 from 'char [8]' to 'const struct tagVARIANT &'
Reason: cannot convert from 'char [8]' to 'const struct tagVARIANT'
No constructor could take the source type, or constructor overload resolution was ambiguous
d:\imagebutton\imagebuttondlg.cpp(121) : error C2228: left of '.BlinkInterval' must have class/struct/union type
Error executing cl.exe.
0 Kudos
Message 3 of 4
(7,135 Views)
Hi khoja,

What David mentioned should have worked.  One thing to remember with the OffImages and OnImages functions is that there are two overloaded methods for each (one has a long imageIndex parameter and the other has a const CString& imageName parameter).  See if you can run this simple program that changes the icon at run-time time using the OffImages method.

Let me know if you have any further troubles!

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 4 of 4
(7,120 Views)