How do you move items in visual basic
-
Saturday, August 08, 2009 7:07 PM
I actually have to questions related to the same subject. First, I would like to know how to drag and drop items from a toolbox, for example, and onto a control coded to accept them.
My second question is how could I move a form, with the mouse, that is completely customised.
Thanks!- Moved by nobugzMVP, Moderator Saturday, August 08, 2009 7:16 PM not a clr q (From:Common Language Runtime)
All Replies
-
Saturday, August 08, 2009 9:06 PM
Hello Developer911,
Take a look at the following link for drag and drop:
http://www.vb-helper.com/howto_net_drag_drop.html
What do you mean by "how could I move a form, with the mouse, that is completely customised"? Are you saying there is no longer a TitleBar on your Form? If so, all you need to do is use this API:
Const WM_NCHITTEST As Integer = &H84 Const HTCLIENT As Integer = &H1 Const HTCAPTION As Integer = &H2 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Select Case m.Msg Case WM_NCHITTEST MyBase.WndProc(m) If m.Result = HTCLIENT Then m.Result = HTCAPTION Case Else 'Make sure you pass unhandled messages back to the default message handler. MyBase.WndProc(m) End Select End Sub
Best regards,
Adjutor- Marked As Answer by Xingwei Hu Friday, August 14, 2009 3:15 AM
-
Sunday, August 09, 2009 7:39 PMhave a look here:
http://www.visualbasic.happycodings.com/Other/code27.html
and here
http://visualbasic.freetutes.com/learn-vb6/lesson15.html
DeepF1 -
Monday, June 13, 2011 12:14 PM
ProgrammingPages.net
Best Programming Resources and Source Code Examples for Java, Php, Visual Basic, C++ ,Asp, Python, Javascript, Ada, Cobol ,C, C#, Delphi, Fortran, Logo, Ruby, Xml.
http://www.programmingpages.net

