Here is a small quick example of how you can incorporate a side bar / side form / side menu to your application. All this does is show a borderless form at the location of the label when you hover your mouse over it. Sample project as well as a picture of it "in action" is at the end.
There really isn't much to the code... in Form1 there is one label on the right side of the form, and the code in it:
Form2 is just a borderless form, with a button created on it, with a simple Me.Hide() command in order to hide the form when clicked.VB Code:
'class level, in form1 Private Form2 As New Form2 'the menu form 'displays form on mouse enter Private Sub Label1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseEnter Form2.Show() 'gets location of label in screen coordinates, so we can set the position appropriately... Form2.Location = Me.PointToScreen(New Point(Me.Label1.Location.X + Label1.Width, Me.Label1.Location.Y)) 'I found that putting the .Location before the .Show method sometimes 'resulted in a weird starting location for the side form End Sub




Reply With Quote