Jump to content
Sign in to follow this  

Text alignment in toolbar control

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 $hToolbar = _GUICtrlToolbar_Create($hGUI,$TBSTYLE_TRANSPARENT)
_GUICtrlToolbar_AddString($hToolbar,'Item# 1')
_GUICtrlToolbar_AddString($hToolbar,'Item# 2')
_GUICtrlToolbar_AddString($hToolbar,'Item# 3')
Until GUIGetMsg() = -3 ; GUI_EVENT_CLOSE

The code above will prodoce a window that will look like


When the words fail... music speaks

Share this post

Link to post
Share on other sites

Would something like this be what you want?  



Share this post

Link to post
Share on other sites

It's not related with what I asked. I just want to display the text vertically aligned.

When the words fail... music speaks

Share this post

Link to post
Share on other sites

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)

Share this post

Link to post
Share on other sites

Thank you, but this is weird. If I use just text then size of bitmaps should be by default 0. Anyway, many thanks.

When the words fail... music speaks

Share this post

Link to post
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
Sign in to follow this  

  • Similar Content

    • Epic007
      By Epic007
      Hey guys I'm stuck with a program.....I need a make an automation which copies text from a chat bot app and paste it in notepad to log the replies of my chat bot and to analyse stuff....a lil help pls
      Thanks in advance
    • nooneclose
      By nooneclose
      I need to send a string of text to this popup and click on the ok button to save it.
      Here is the code I have so far:
      ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500)  
      Here is the popup:

    • reida
      By reida
      Hello. Help to write the text.
      <textarea tabindex="4" class="js-input compose__labels__input" style="width: 407px; max-width: 413px;" wrap="off" autocomplete="off" data-original-name="To"></textarea>  I can not make.
      #include <IE.au3> $sLogin = 'adv' $iError = 1 $sUrl = 'https://......' $oIE = _IECreate($sUrl) ;;; _IELoadWait($oIE) $oLogin = _IEGetObjByName($oIE, "To") Sleep(7000) If IsObj($oLogin) Then _IEFormElementSetValue($oLogin, $sLogin) _IELoadWait($oIE) ; EndIf EndIf Through the selector it can be possible?
      #toolkit-154163367424641composeForm > div:nth-child(1) > div > div.compose-head__content.js-collapsed-off > div.compose-head__row-wrapper.compose-head__row-wrapper_to.js-row > div > div > div:nth-child(2) > div > div > div > textarea.js-input.compose__labels__input  
    • cramaboule
      By cramaboule
      Hi all,
      I was wondering if it is possible (and how) to put text on video on-the-fly (like VLC displays Title movie at the begining)
      and of course doing that in AutoIt
      Thanks in advance...
    • ISI360
      By ISI360
      I currently have probelms trying to create a vertical toolbar with a rebar.
      The Controls create and works fine...until i change some state of it. Then it will mess up everything when the mouse is moving over the buttons.

      Please can someone explain me what i´m doing wrong here??
      #include <Constants.au3> #include <GuiButton.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <GuiImageList.au3> #include <GuiReBar.au3> #include <GuiToolbar.au3> #include <WindowsConstants.au3> Global $hGui, $hGui2, $hReBar, $aStrings[5] Global Enum $Hruntest = 1000, $Hconfig, $hDisplayCSV, $H_netmon, $H_graphdisplay, $H_netmon1 $hGui = GUICreate("Rebar", 900, 396, 400, 200, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX)) $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 55) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 130) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 154) Global $hToolbar = _GUICtrlToolbar_Create($hGui, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN, $TBSTYLE_WRAPABLE) ) _GUICtrlToolbar_SetImageList($hToolbar, $hImage) _GUICtrlToolbar_AddButton($hToolbar, $Hruntest, 0, 0,BitOR($BTNS_DROPDOWN, $BTNS_WHOLEDROPDOWN)) _GUICtrlToolbar_AddButton($hToolbar, $Hconfig, 1, 1 ) _GUICtrlToolbar_AddButton($hToolbar, $hDisplayCSV, 2, 2) _GUICtrlToolbar_AddButton($hToolbar, $H_graphdisplay, 3, 3) _GUICtrlToolbar_AddButton($hToolbar, $H_netmon, 4, 4) _GUICtrlToolbar_AddButton($hToolbar, $H_netmon1, 5, 5) $hReBar = _GUICtrlRebar_Create($hGui, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $CCS_VERT, $RBS_FIXEDORDER )) _GUICtrlToolbar_SetButtonSize($hToolbar, 30 , 22 ) _GUICtrlRebar_AddToolBarBand($hReBar, $hToolbar, "", -1, $RBBS_NOGRIPPER ) GUISetState(@SW_SHOW) MsgBox(0,"Demo","At the moment everything is ok. The vertical toolbar is created and works with no problems!"&@crlf&@crlf&"But now let us disable for example the first button...",0,$hGui) _GUICtrlToolbar_SetButtonState($hToolbar, $Hruntest, $TBSTATE_INDETERMINATE ) MsgBox(0,"Demo","...and now it´s getting buggy! :P"&@crlf&"Move the mouse over the buttons and see yourselfe... (after closing this dialog)",0,$hGui) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd

      Thanks in advance!