Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

VS 2010 How To Remove Small White Lines Around MenuStrip-DropDownItems

$
0
0
Hey guys! :)

I have a little problem with these small white lines next to the dropdownitems of my menustrip:

Name:  Screenshot (29).png
Views: 5
Size:  7.0 KB

I don´t know what to override to remove them :( I already removed the right and left ones by following code:

Code:

Private Class MyRenderer : Inherits ToolStripProfessionalRenderer
        Protected Overrides Sub OnRenderToolStripBorder(e As System.Windows.Forms.ToolStripRenderEventArgs)
            MyBase.OnRenderToolStripBorder(e)

            Dim rc As New Rectangle(Point.Empty, e.ConnectedArea.Size)

            e.Graphics.FillRectangle(Brushes.Gray, rc)
            e.Graphics.DrawRectangle(Pens.Gray, 1, 0, rc.Width - 2, rc.Height - 1)
        End Sub
        Protected Overrides Sub OnRenderMenuItemBackground(ByVal e As System.Windows.Forms.ToolStripItemRenderEventArgs)
            If My.Settings.SkinModern = True Then
                If e.Item.Selected Then
                    Dim rc As New Rectangle(Point.Empty, e.Item.Size)

                    e.Graphics.FillRectangle(Brushes.SkyBlue, rc)
                    e.Graphics.DrawRectangle(Pens.SkyBlue, 1, 0, rc.Width - 2, rc.Height - 1)
                Else
                    Dim rc As New Rectangle(Point.Empty, e.Item.Size)

                    e.Graphics.FillRectangle(Brushes.Gray, rc)
                    e.Graphics.DrawRectangle(Pens.Gray, 1, 0, rc.Width - 2, rc.Height - 1)
                End If
            End If
        End Sub
    End Class

I hope you have an idea :)
Attached Images
 

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>