Make another form called form1, set it's borderstyle to 4 - Fixed Dialog, and add:
Code:
Option Explicit
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
If Source.Name = "Toolbar1" And X > 20 Then
Form1.Show
Toolbar1.Visible = False
If Source.Name = "Toolbar1" And X <= 20 Then
Unload Form1
Toolbar1.Visible = True
End If
End Sub
To the primary form (assuming it's called "frmForm1" and add
Code:
Option Explicit
Private Sub Form_Unload(Cancel As Integer)
frmForm1.Toolbar1.Visible = True
End Sub
to the "Form1" that we added.
(The second form is the floating version, so make it look like a floating toolbar).
API and Code.