Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Community Wiki Home
guest| Join | Help | Sign In
Liberty BASIC Community Wiki
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members
  • Home
    • Liberty BASIC FAQ
    • Contests
    • Tutorials
    • Science
    • Shared Code
    • Tips
    • DLLs
    • PublicDomainSprites
    • Member Pages
    • Links
    • Sandbox

Make bmp button

Edit 9 7 …
  • 0 Tags
    • No tags
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

KcDan KcDan May 27, 2006

Some people may desire a different style of bitmap buttons. The kind LB has native when pressed inverts the color and nothing happens when you roll over the button, so it may look a bit ugly in some applications.

The Windows native way of doing this is having a button with the style _BS_BITMAP and the sending the message _BM_SETIMAGE with the handle of the graphic.

Heres a function I made that simplifies this process, all you have to do is supply that with the handle of the button and the handle to the graphic and it will do everything for you.

function MakeButtonGraphic(hBttn,hGfx) calldll #user32, "GetWindowLongA",hBttn as ulong,_ _GWL_STYLE as long,style as long style=style or _BS_BITMAP calldll #user32, "SetWindowLongA",hBttn as ulong,_ _GWL_STYLE as long,style as long,ret as long calldll #user32, "SendMessageA",hBttn as ulong,_ _BM_SETIMAGE as long,0 as long,hGfx as ulong,_ MakeButtonGraphic as long end function
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://basic.wikispaces.com/ are licensed under a Creative Commons Attribution Share-Alike 2.5 License. Creative Commons Attribution Share-Alike 2.5 License
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...