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 5 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
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...
I am creating a program that when you print an author, you must show all the information of all the books that the author has written. Add a new attribute in the Author class that will be "BooksWriting: List (Book)".
I have expanded the program so that it also ...
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...