I am interested in creating a winamp like docking experience with my
program. I'm only interested in docking the main form to the edge of
the screen (not docking forms to each other, although that'd be nice).
I have posted before, but now I'm thinking that hWnd can be used
somehow:
http://groups.google.com/group/microsoft.public.vb.general.discussion/browse_thread/thread/1a6101384e44a017/
Any input would be awesome. Or if someone knows of another method that
works, that'd be great too!
Thanks,
Matt
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
<Matthe...@gmail.com> wrote in message
news:1139456253.4...@o13g2000cwo.googlegroups.com...
Thanks a lot! I'm really excited as this is really simple;
cMagneticwnd always kept crashing on me.
Thanks,
Matt
'-----------------------Start Code-----------------
Option Explicit
Dim oDock As cDockingHandler
Private Sub Form_Load()
Set oDock = New cDockingHandler
Set oDock.ParentForm = Me
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If Button = vbLeftButton Then
oDock.StartDockDrag X, Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If Button = vbLeftButton Then
oDock.UpdateDockDrag X, Y
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set oDock = Nothing
End Sub
'-----------------------End Code-------------------------------
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
<Matthe...@gmail.com> wrote in message
news:1139489940.1...@z14g2000cwz.googlegroups.com...
eh chem... sorry. That's exactly what I need. I'm not using a border
on the main form either so this is absolutely positively [insert
exaggerated positive emotional adjective here] p e r f e c t. I am
equally as grateful.
Is there a way to have this work with different windows, even if
they're not children?
Thanks!!!
Matt
Different windows? Just include the code in the form and it will work with
any form in your project. is that what you mean?
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
<Matthe...@gmail.com> wrote in message
news:1139533860.1...@g47g2000cwa.googlegroups.com...
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Veign" <NOSPAM...@veign.com> wrote in message
news:%23kHVQCe...@TK2MSFTNGP14.phx.gbl...
I was using the method that Randy stated on this post:
http://groups.google.com/group/microsoft.public.vb.general.discussion/browse_thread/thread/1a6101384e44a017/
I'm actually interested in moving the form when a picturebox is clicked
and dragged currently here is code:
'global decs
Private Const HTCAPTION As Long = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If Button = vbLeftButton Then
If CTRLClick = True Then
If (Shift And vbCtrlMask) = vbCtrlMask Then
ReleaseCapture
SendMessage Me.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0&
End If
ElseIf CTRLClick = False Then 'just a left-click, no keys
ReleaseCapture
SendMessage Me.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0&
End If
End If
End Sub
I tried to put oDock.UpdateDockDrag X, Y and oDock.StartDockDrag X, Y
in there and obviously it just wasn't working (since the
.updatedockdrag property would produce the original location only in
mousedown).
Thanks!
I'm seriously excited!
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If Button = vbLeftButton Then
If CTRLClick = True Then
If (Shift And vbCtrlMask) = vbCtrlMask Then
oDock.StartDockDrag X, Y
End If
ElseIf CTRLClick = False Then 'just a left-click, no keys
oDock.StartDockDrag X, Y
End If
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If Button = vbLeftButton Then
If CTRLClick = True Then
If (Shift And vbCtrlMask) = vbCtrlMask Then
oDock.UpdateDockDrag X, Y
End If
ElseIf CTRLClick = False Then 'just a left-click, no keys
oDock.UpdateDockDrag X, Y
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
<Matthe...@gmail.com> wrote in message
news:1139539775.7...@g14g2000cwa.googlegroups.com...
I got stuck last night, then figured i'd sleep on it.
How can I set the default pixels? Since it normally gets set in class
initialize, you really can't set it after the project has loaded
(right?).
I was attempting to set mSnapDistance (and convert it to twips) before
every function call, but that doesn't seem to work.
Any ideas?
Thanks,
Matt
All you had to do was change the value in the form load event. Add a line
after setting the ParentForm and set it to a value like:
700 * Screen.TwipsPerPixelX
(with such a large value you will see the change).
I uploaded a newer version so you won't have to convert to twips. You would
be able to pass a value in pixels to the SnapDistance property.
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
<Matthe...@gmail.com> wrote in message
news:1139572704.3...@g44g2000cwa.googlegroups.com...
I set the DEFAULT_SNAP_DISTANCE as a public variable in a module.
Thanks again man, I'll be the first to say that this is the first
docking class i've seen that functions properly.
Are hope for docking windows to each other (like the winamp's eq,
playlist, etc.)?
Is there any serious documentation on the class anywhere?
Thanks,
Matt
Honestly if you play with the class a bit more you will find that it doesn't
really need any documentation.
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
<Matthe...@gmail.com> wrote in message
news:1139619089.1...@o13g2000cwo.googlegroups.com...
Thanks for keeping with this post. I really appreciate it.
Take care,
Matt