Results 1 to 3 of 3

Thread: Wrap text in toolbar button

  1. #1

    Thread Starter
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    Wrap text in toolbar button

    Hi

    I'm dynamically adding buttons to a toolbar control as shown below:
    VB Code:
    1. Dim menuitem As CMenuItem
    2.         Dim tbutton As ToolBarButton
    3.         tbrMenu.Buttons.Clear()
    4.         For Each menuitem In menulist
    5.             tbutton = New ToolBarButton()
    6.             With tbutton
    7.                 .Text = menuitem.MenuCaption
    8.  
    9.             End With
    10.             tbrMenu.Buttons.Add(tbutton)
    11.         Next

    Some of the captions are quite long and the button is getting wide. How can I keep the button to a fixed width and then force the text to wrap itself if the width of the button is not enough?

    Thanks
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  2. #2

    Thread Starter
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651
    On another note, can somebody route me to a good tutorial on the Toolbar on the web?

    Thanks
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  3. #3
    Member
    Join Date
    Sep 2003
    Location
    Amsterdam, Holland
    Posts
    36
    I saw you created dynamic toolbar with toolbarbuttons.
    I created a dymanic toolbar to and it works.
    But everytime I press on one the buttons the "button_click"
    is fired 6 times (I think the 6 times is because I created 6 buttons)

    Do you have to same problem and can you help me to resolve this?

    Thank a lot,
    AXH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width