Microsoft KB Archive/98927

{| = How to Refresh Buttons with .BMP Pictures =
 * width="100%"|

ID: Q98927

2.5x 2.6x 3.00 | 2.5x 2.60a

WINDOWS       | MACINTOSH kbprg The information in this article applies to:


 * Microsoft Visual FoxPro for Windows, version 3.0
 * Microsoft FoxPro for Windows, versions 2.5x, 2.6x
 * Microsoft FoxPro for Macintosh, versions 2.5x, 2.6a

SUMMARY
To change pictures when you are using bitmap files for buttons, use the SHOW GET command with a PROMPT clause. The syntax of this command is as follows:

SHOW GET [,  [PROMPT ]] [ENABLE | DISABLE] [LEVEL ] [COLOR SCHEME  | COLOR ] NOTE: Even if you have a push button with only one prompt, you must still specify the button number (in this case, 1) after the variable name.

MORE INFORMATION
The following information was extracted from the online Help file:

You can replace the prompt for an individual push button, radio button or check box with another prompt by including PROMPT .  replaces the original button or check box prompt. You can also change the button or check box attributes (which determine  whether the control is enabled or disabled, what hot keys are   assigned, and whether it is the default or Escape choice) by   specifying the appropriate special characters with . In FoxPro for Windows, you can use PROMPT to specify .BMP files (bitmapped pictures) that are displayed on a picture check box, push button, or radio button when it is enabled, selected, and disabled. In FoxPro version 2.5 for MS-DOS, the PROMPT clause is ignored if .BMP files are specified in the PROMPT clause. The example that follows shows how to use the SHOW GET command with push buttons, radio buttons, and check boxes. In this example, all .BMP files are in the directory C:\BMP:

@ 1.750,9.140 SAY &quot;Push Buttons&quot; * Defines a push button with a .BMP picture. @ 2.750,9.140 GET mpush PICTURE &quot;@*BHN c:\bmp\cars.bmp&quot;; SIZE 2.100,6.00,1.286 ; DEFAULT 0 ; FONT &quot;Times New Roman&quot;, 12 ; STYLE &quot;B&quot; ; VALID pushrefr

* Defines two radio buttons with a .BMP prompt. @ 5.750,9.140 SAY &quot;Radio Buttons&quot; @ 6.750,9.140 GET mradio ; PICTURE &quot;@*BHN c:\bmp\argyle.bmp; c:\bmp\cars.bmp&quot;; STYLE &quot;T&quot;; VALID radrefre; DEFAULT 0

* Defines a check box with a .BMP prompt. @ 9.750,9.140 SAY &quot;Check Boxes&quot; @ 10.750,9.140 GET mcheck PICTURE &quot;@*cBhn c:\bmp\egypt.bmp&quot;; STYLE &quot;T&quot;; VALID checkref; DEFAULT 1

READ CYCLE

FUNCTION pushrefr && Refreshes the push button * At that point, only the first option should be necessary. SHOW GET mpush,1 PROMPT ; &quot;c:\bmp\chitz.bmp,c:\bmp\argyle.bmp,c:\bmp\castle.bmp&quot; * Refreshes the prompt. Here only the first option is actually used.

FUNCTION radrefre * Refreshes the radio button. y=&quot;c:\bmp\cars.bmp,c:\bmp\cars.bmp,c:\bmp\cars.bmp&quot; z=&quot;c:\bmp\argyle.bmp,c:\bmp\argyle.bmp,c:\bmp\argyle.bmp&quot; SHOW GET mradio,1 PROMPT y && Switch prompts for the buttons. SHOW GET mradio,2 PROMPT z

FUNCTION checkref * Refreshes the check box.

SHOW GET mcheck,1 PROMPT &quot;c:\bmp\flock.bmp&quot;

*: EOF: TEST.PRG Additional reference words: VFoxWin 3.00 FoxWin FoxMac 2.50 2.50a 2.50b 2.50c 2.60 2.60a @...GET PROMPT KBCategory: kbprg KBSubcategory: FxprgGeneral Keywords         : FxprgGeneral Version          : 2.5x 2.6x 3.00 | 2.5x 2.60a Platform         : MACINTOSH WINDOWS
 * }