Jump to content

Text alignment in toolbar control


Go to solution Solved by jguinch,

Recommended Posts

Why the text it's not vertically aligned in toolbar control?

#include <GuiReBar.au3>
#include <GuiToolbar.au3>
#include <Constants.au3>

Global Enum $Item1 = 1000, $Item2, $Item3

Local $hGUI = GUICreate('Example',450,300)
Local $hRebar = _GUICtrlRebar_Create($hGUI, BitOR($RBS_FIXEDORDER,$CCS_NODIVIDER,$RBS_BANDBORDERS))
Local $hToolbar = _GUICtrlToolbar_Create($hGUI,$TBSTYLE_TRANSPARENT)
_GUICtrlToolbar_AddString($hToolbar,'Item# 1')
_GUICtrlToolbar_AddString($hToolbar,'Item# 2')
_GUICtrlToolbar_AddString($hToolbar,'Item# 3')
_GUICtrlToolbar_AddButton($hToolbar,$Item1,-2,0)
_GUICtrlToolbar_AddButton($hToolbar,$Item1,-2,1)
_GUICtrlToolbar_AddButton($hToolbar,$Item1,-2,2)
_GUICtrlToolbar_SetButtonSize($hToolbar,32,150)
_GUICtrlRebar_AddToolBarBand($hRebar,$hToolbar)
GUISetState(@SW_SHOW,$hGUI)
Do
    Sleep(10)
Until GUIGetMsg() = -3 ; GUI_EVENT_CLOSE

The code above will prodoce a window that will look like

21l6edx.png

When the words fail... music speaks.

Link to comment
Share on other sites

  • Solution

Because of the size of your undefinied bitmaps : the text is placed under the bitmap, but you don't have any bitmap...

So just define the size of the bitmaps - even if you do not use any

Local $hToolbar = _GUICtrlToolbar_Create($hGUI,$TBSTYLE_TRANSPARENT)
_GUICtrlToolbar_SetBitmapSize($hToolbar, 0, 0)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...