User Tools

Site Tools


displaying_20an_20icon_20on_20a_20pushbutton

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
displaying_20an_20icon_20on_20a_20pushbutton [2018/03/31 13:19] – external edit 127.0.0.1displaying_20an_20icon_20on_20a_20pushbutton [2024/01/05 00:22] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 //by Richard Russell, March 2016//\\ \\  The main //BBC BASIC for Windows// help documentation tells you how to [[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#fnbutton|display a BMP image on a pushbutton]] but not how to display an icon (ICO file) instead. The simple code below shows how to do that:\\  //by Richard Russell, March 2016//\\ \\  The main //BBC BASIC for Windows// help documentation tells you how to [[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#fnbutton|display a BMP image on a pushbutton]] but not how to display an icon (ICO file) instead. The simple code below shows how to do that:\\ 
 +<code bb4w>
         BM_SETIMAGE = &F7         BM_SETIMAGE = &F7
         BS_ICON = 64         BS_ICON = 64
Line 22: Line 23:
         PRINT "Button clicked!"         PRINT "Button clicked!"
         ENDPROC         ENDPROC
 +</code>
 This code is for a standalone button displayed in the main window, but can easily be adapted for a button in a dialogue box (change the **SendMessage** call to a **SendDlgItemMessage**).\\ \\  You can similarly display an icon on a **static control** as follows:\\  This code is for a standalone button displayed in the main window, but can easily be adapted for a button in a dialogue box (change the **SendMessage** call to a **SendDlgItemMessage**).\\ \\  You can similarly display an icon on a **static control** as follows:\\ 
 +<code bb4w>
         IMAGE_ICON = 1         IMAGE_ICON = 1
         LR_LOADFROMFILE = 16         LR_LOADFROMFILE = 16
Line 39: Line 42:
         UNTIL FALSE         UNTIL FALSE
         END         END
 +</code>
displaying_20an_20icon_20on_20a_20pushbutton.1522502356.txt.gz · Last modified: 2024/01/05 00:18 (external edit)