The Toolbar Add Separator statement is not functioning as documented.
Unless I am missing something it the help file as well.
Try this:
Code:
Control Add Toolbar, hDlg, 500,"", 0,0,0,0, %ccs_top, %ws_ex_staticedge Toolbar Add Button hDlg, 500, 0, 101, %tbstyle_button,"X" ' Toolbar Add Separator hdlg, 500, 100 Toolbar Add Button hDlg, 500, 0,0, %tbstyle_sep, "" Toolbar Add Button hDlg, 500, 0, 102, %tbstyle_button,"Y" ' Toolbar Add Separator hdlg, 500, 100 Toolbar Add Button hDlg, 500, 0,0, %tbstyle_sep, "" Toolbar Add Button hDlg, 500, 0, 103, %tbstyle_button,"Z" Local datav& Toolbar Get Count hDlg, 500 To datav& MsgBox "ToolBar count = " + Str$(datav&), %mb_ok Or %mb_taskmodal
Even if the size of the separator is 100, 300, 10 or anything, the separator "buttons" is still displayed the same size.
The size is derived from the button size, which is determined by the size of the text.
A toolbar automatically sets the width of its buttons when you add a string to the toolbar that is longer than any current toolbar string. The width is set to accommodate the longest string in the toolbar.
Try giving one button the text of " ZZZZZZZZZZZZZZZZ" and see what it does.
It seems that the Toolbar Add Separator somehow confuses the toolbar when it is added as a weird/unknown/funny "button"

Leave a comment: