Results 1 to 10 of 10

Thread: Transparent contextmenustrip image margin

Threaded View

  1. #8
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Transparent contextmenustrip image margin

    Quote Originally Posted by freeblog View Post
    Surely this can simply be over ridden by using Me.BackColor = Color.Transparent :/ you would of thought any way.
    I've never done anything like that so don't really have a clue, I also don't have WinXP, but using Win7 I added this to your class,...

    Code:
    Protected Overrides Sub OnRenderImageMargin(e As System.Windows.Forms.ToolStripRenderEventArgs)
        ' by disabling the line below the image margin is now transparent. (Win7 test only)
        'MyBase.OnRenderImageMargin(e)
    End Sub
    For testing I did this and attached an image of what my menu looks like.
    Code:
    Dim mymenu As New ContxtMenu ' < class name changed due to conflict.
    mymenu.BackColor = Color.Coral
    mymenu.Items.Add("Testing 123", My.Resources.eventlog.ToBitmap)
    mymenu.Items.Add("Testing 456", My.Resources.eventlogInfo.ToBitmap)
    mymenu.Items.Add("Testing 789", My.Resources.eventlogWarn.ToBitmap)
    Me.ContextMenuStrip = mymenu
    Attached Images Attached Images  

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