Step 5
Put the following code in your Form_Load event. It sets the MenuStrip and ToolStrip renderer to the custom renderer:
If you added these controls in a ToolStripContainer, use the following code to make the background of the ToolStripContainer the same as the MenuStrip background:Code:MenuStrip1.Renderer = New clsMenuRenderer ToolStrip1.Renderer = New clsToolstriprenderer
Code:Private Sub ToolStripContainer1_TopToolStripPanel_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles ToolStripContainer1.TopToolStripPanel.Paint Dim g As Graphics = e.Graphics Dim rect As New Rectangle(0, 0, ToolStripContainer1.Width, Me.Height) Dim b As New Drawing2D.LinearGradientBrush(rect, clrHorBG_GrayBlue, clrHorBG_White, Drawing2D.LinearGradientMode.Horizontal) g.FillRectangle(b, rect) End Sub Private Sub ToolStripContainer1_TopToolStripPanel_SizeChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripContainer1.TopToolStripPanel.SizeChanged ToolStripContainer1.Invalidate() End Sub
That's it!
If you have any questions / suggestions, feel free to let me know!




Reply With Quote