You can use the MouseMove event and check if the mouse pointer is within the Bounds of the stripmenu item.
If that's the case, simply change the BackgroundColor.
Private Sub menuitem1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) If menuitem1.Bounds.Contains(e.Location) Then menuitem1.BackColor = Color.Beige Else menuitem1.BackColor = Color.White End If End Sub
Edited 4 Years Ago by Oxiegen: n/a
This does not solve my problem. The Highlight color still is blue. I don't know where I can choose the highlight color, there isn't any option, and I didn't found any solution on the Internet. Please help me.
Alright. Try this instead.
In the forms load event, add this line:
<name of menustrip>.Renderer = New MyRenderer Then, within the forms own class add a private class called MyRenderer which inherits ToolStripProfessionalRenderer.
Private Class MyRenderer : Inherits ToolStripProfessionalRenderer Protected Overrides Sub OnRenderMenuItemBackground(ByVal e As System.Windows.Forms.ToolStripItemRenderEventArgs) If e.Item.Selected Then Dim rc As New Rectangle(Point.Empty, e.Item.Size) 'Set the highlight color e.Graphics.FillRectangle(Brushes.Beige, rc) e.Graphics.DrawRectangle(Pens.Beige, 1, 0, rc.Width - 2, rc.Height - 1) Else Dim rc As New Rectangle(Point.Empty, e.Item.Size) 'Set the default color e.Graphics.FillRectangle(Brushes.Gray, rc) e.Graphics.DrawRectangle(Pens.Gray, 1, 0, rc.Width - 2, rc.Height - 1) End If End Sub End Class
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click Dim txtB1 As New TextBox Dim i For i = ...