Results 1 to 6 of 6

Thread: [VB .NET] [Controls] SplitButton Control

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    629

    [VB .NET] [Controls] SplitButton Control

    For my program I needed a splitbutton, but I had to convert it from c# to vb .net. Original source:
    http://blogs.msdn.com/b/jfoscoding/a...10/491523.aspx


    Usage:
    After adding it to your form (like any other control), add a contextmenustrip. Set the "ContextMenuStrip" property of the added SplitButton to this contextmenustrip. Finally, add some menuitems to the toolstrip or maybe change its layout a bit.

    To open the context menu, click on the arrow. To click the button, click outside this arrow (on the text). When pressing space it will click the button, any other key will activate the dropdown menu.
    Attached Files Attached Files

  2. #2

    Re: [VB .NET] [Controls] SplitButton Control

    Good control, but right clicking will still show a ContextMenuStrip...is there a way to kill that?

  3. #3
    New Member
    Join Date
    Aug 2014
    Posts
    10

    Re: [VB .NET] [Controls] SplitButton Control

    I can't assign an image to my Split Button control. It's a shutdown menu and I want the split button image to be a shutdown image, but the image doesn't show up. What do I do?

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    Re: [VB .NET] [Controls] SplitButton Control

    Quote Originally Posted by soulblazer View Post
    I can't assign an image to my Split Button control. It's a shutdown menu and I want the split button image to be a shutdown image, but the image doesn't show up. What do I do?
    The OP's last activity was back in May of 2014, so I'm not sure if he'll come back to answer your question. However, I downloaded the file and examined the code. It appears as if the style of the button is drawn manually in the OnPaint event using the ButtonRenderer.DrawButton Method. What I would suggest doing is using one of the overloads that accepts an image.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  5. #5
    New Member
    Join Date
    Aug 2014
    Posts
    10

    Re: [VB .NET] [Controls] SplitButton Control

    Quote Originally Posted by dday9 View Post
    The OP's last activity was back in May of 2014, so I'm not sure if he'll come back to answer your question. However, I downloaded the file and examined the code. It appears as if the style of the button is drawn manually in the OnPaint event using the ButtonRenderer.DrawButton Method. What I would suggest doing is using one of the overloads that accepts an image.
    Thank you.

  6. #6
    Member
    Join Date
    Aug 2004
    Location
    Sao Paulo / Brazil
    Posts
    38

    Re: [VB .NET] [Controls] SplitButton Control

    Nice code!
    --------------------------------------
    All your base are belong to us.

Tags for this Thread

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