Text alignment in Drop Down Menus

Share your advanced PureBasic knowledge/code with the community.
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Text alignment in Drop Down Menus

Post by RichardL »

Code updated For 5.20+

I'm probably the last person on the planet to find this out, but just in case there is someone else who does not know.

The TAB character (Chr(9)) can be used in drop down menus to align a feature such as "Ctrl+S"

Example:

Code: Select all


If CreateMenu(0, WindowID(#Window))
  MenuTitle("File")
  MenuItem( 603,"Save current data")
  MenuItem( 604,"Load data")
  MenuBar()
  OpenSubMenu("Save display...")
  MenuItem(607,"To file"   +Chr(9)+"Ctrl+S")
  MenuItem(606,"To clip"   +Chr(9)+"Ctrl+C")
  MenuItem(605,"To printer"+Chr(9)+"Ctrl+P")
  CloseSubMenu()  
  MenuItem(608,"Beeps On/Off")

  etc