Private Sub SplitContainer1_SplitterMoving(ByVal sender As Object, _
ByVal e As SplitterCancelEventArgs) Handles SplitContainer1.SplitterMoving
Me.SplitContainer1.BackColor = Color.Red
End Sub
Private Sub SplitContainer1_SplitterMoved(ByVal sender As Object, _
ByVal e As SplitterEventArgs) Handles SplitContainer1.SplitterMoved
Me.SplitContainer1.BackColor = SystemColors.Control
End Sub
This is EXACTLY why I told you to test it. Had you done so you'd already know that the MouseHover event of the SplitContainer is ONLY raised when the mouse cursor hovers over the splitter bar. That's because on each side of the bar is a SplitterPanel that has its own events. It's the MouseHover event of one of those SplitterPanels that will be raised when the mouse cursor hovers over them. Don't assume, especially when you're a beginner and especially when someone else specifically indicates that you should investigate something. Test. Then you know.The only event I think would be applicable would be the mousehover event. But mousehover applies to the splitcontainer as a whole.
How do I trap the mousehover event only IF the mouse is over the splitter (when the cursor changes to splitter cursor) THEN color splitter red.
Private SplitColor As System.Drawing.Color
Private Sub SplitContainer1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SplitContainer_Live.MouseEnter
SplitColor = SplitContainer1.BackColor
SplitContainer1.BackColor = Drawing.Color.LightGreen
End Sub
Private Sub SplitContainer1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SplitContainer1.MouseLeave
SplitContainer1.BackColor = SplitColor
End Sub