Results 1 to 3 of 3

Thread: [2008] Toolstrip Renderer [img Inside]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2007
    Posts
    258

    [2008] Toolstrip Renderer [img Inside]

    Alright, I'm using Menu Strips because I find it really easy to use, but I have a problem, when I add a BackGround Image to my Program, I get either a White Line down the Side of it, or right at a Bottom.

    Here is the Image of what I mean.

    http://img231.imageshack.us/my.php?image=screenhm8.jpg



    EDIT: I found this, its in C#:


    ToolStrip.Renderer = new MyFancyRenderer();

    public class MyFancyRenderer : ToolStripProfessionalRenderer {

    protected override OnRenderToolStripBorder(ToolStripItemRenderEventArgs e) {
    // dont call base.
    }


    How do I get this to work in VB.NET ?
    Last edited by Wesley008; Oct 25th, 2008 at 11:16 AM.

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: [2008] Toolstrip Renderer [img Inside]

    That would be something like:

    vb.net Code:
    1. Public Class MyFancyToolStripRenderer
    2.     Inherits ToolStripProfessionalRenderer
    3.  
    4.     Protected Overrides Sub OnRenderToolStripBorder( <args will come automatically> )
    5.         'Emtpy sub
    6.     End Sub
    7. End Class

    Note that as soon as you finish writing "Protected Overrides Sub OnRenderToolStripBorder(" it will probably auto-complete and it will add a "MyBase.RenderToolStripBorder" or something like that. The C# code comment tells you to remove that so the base 'render toolstrip border' code does not get called.

    I don't know if this will fix your code but it's worth a shot...


    If you still don't understand perhaps have a look at my signature for the VS2008 style MenuStripRenderer, you can find a full example on how to use a ToolStripRenderer there.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2007
    Posts
    258

    Re: [2008] Toolstrip Renderer [img Inside]

    Worked like a CHarm, Thank You I'll check out your Link in your Sig sometime today. Thanks

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