Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > AUI > AUI_CONTROL > Control Types > Button Control

Add Icon or Bitmap to Button

Scroll Prev Top Next More

In Windows Vista and above, you can add an icon or bitmap to any button. The concept is similar to the Command Link button, except without the secondary text (and thus may be suitable for more "normal" sized buttons.) As with Command Link buttons, they are requested purely by means of the syntax of the ctext parameter contents, which must be:

ctext = text$ + "~" + iconspec$

The syntax options for iconspec$ are the same as for Command Link buttons.

If the version of Windows does not support the feature, the iconspec$ will just be ignored.

ashref_img103

Note that as with the Command Link buttons, the image displays on the left of the text. But here the image is allocated the entire left half of the button, while the text gets the right half. And the right side of the image will be adjacent to the left edge of the text. If you prefer some spacing between them, add space(s) to both ends of the text$ string. (The leading space provides the separate with from the image, but the trailing space will help maintain centering of the text within the button if the image option is not supported.)

See the sample program IMGTXTBTN in EXLIB:[908,51] for an example.

History

2010 September, 5.1.1192:  added to A-Shell