PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Move VB 10 Border less Form-VBForums
Results 1 to 14 of 14

Thread: [RESOLVED] Move VB 10 Border less Form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2011
    Posts
    121

    Resolved [RESOLVED] Move VB 10 Border less Form

    Hey guys! I want some help with a border less form! I want to move the form using the tab control's "backcolor" area like in Google Chrome. Please Help! I really Need This!

    I need to do this with my web browser:

    http://www.youtube.com/watch?v=LJ8ShJYXvew&
    Last edited by rqmok; Oct 15th, 2011 at 12:01 AM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Oct 2011
    Posts
    121

    Re: Move VB 10 Border less Form

    Is there anyone that's going to help me?

  3. #3
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,346

    Re: Move VB 10 Border less Form

    Do you want a C# program to be able to move a VB.NET program? If not this is the wrong forum and I will request the thread moved.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  4. #4
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Move VB 10 Border less Form

    Use the mousedown event. If you have a specific area you wish to operate on and the control does not expose it in any way you will have to check coordinates.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2011
    Posts
    121

    Re: Move VB 10 Border less Form

    sorry I am new to this forum and sometimes I post in the wrong category but since I've already started the thread then why not finish it I need vb 10 Codes. I have tried the mousedown event but it doesn't work. It doesn't let me drag it just stays there but please I need help for VB 10! Thanks!

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,415

    Re: Move VB 10 Border less Form

    Thread moved to the 'VB.Net' (VB2002 and later) forum
    Quote Originally Posted by Nightwalker83 View Post
    ...I will request the thread moved.
    Thanks as always

  7. #7

  8. #8
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: Move VB 10 Border less Form

    try this code.........
    vb Code:
    1. Public Class Form1
    2.     Public Const HT_CAPTION As Integer = &H2
    3.     Public Const WM_NCLBUTTONDOWN As Integer = &HA1
    4.     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
    5.         If e.Button = Windows.Forms.MouseButtons.Left Then
    6.             Me.Capture = False
    7.             Me.WndProc(Message.Create(Me.Handle, WM_NCLBUTTONDOWN, CType(HT_CAPTION, IntPtr), IntPtr.Zero))
    8.         End If
    9.     End Sub
    10. End Class

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Oct 2011
    Posts
    121

    Re: Move VB 10 Border less Form

    thanks medsont

    I am using MDI Tabcontrol that's why it doesn't let the form's background come through and I can't drag the form via the tabcontrol's backcolor area

    I could put on simple tabcontrol but the problem is that I can't change the shape of the tabs and I don't know how to add an 'x' for closing the tab

    thanks guys

  10. #10
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: Move VB 10 Border less Form

    you can use this code for any controls like this
    vb Code:
    1. Public Class Form1
    2.     Public Const HT_CAPTION As Integer = &H2
    3.     Public Const WM_NCLBUTTONDOWN As Integer = &HA1
    4.     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
    5.     Handles Me.MouseDown, TabControl1.MouseDown, TabPage1.MouseDown, TabPage2.MouseDown
    6.         If e.Button = Windows.Forms.MouseButtons.Left Then
    7.             Me.Capture = False
    8.             TabControl1.Capture = False
    9.             TabPage1.Capture = False
    10.             TabPage2.Capture = False
    11.             Me.WndProc(Message.Create(Me.Handle, WM_NCLBUTTONDOWN, CType(HT_CAPTION, IntPtr), IntPtr.Zero))
    12.         End If
    13.     End Sub
    14. End Class



    try this link for TabControl
    http://dotnetrix.co.uk/tabcontrol.htm

  11. #11
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,144

    Re: Move VB 10 Border less Form

    Quote Originally Posted by medsont View Post
    try this code.........
    vb Code:
    1. Public Class Form1
    2.     Public Const HT_CAPTION As Integer = &H2
    3.     Public Const WM_NCLBUTTONDOWN As Integer = &HA1
    4.     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
    5.         If e.Button = Windows.Forms.MouseButtons.Left Then
    6.             Me.Capture = False
    7.             Me.WndProc(Message.Create(Me.Handle, WM_NCLBUTTONDOWN, CType(HT_CAPTION, IntPtr), IntPtr.Zero))
    8.         End If
    9.     End Sub
    10. End Class
    good answer, but that should be the MouseMove event.

    Quote Originally Posted by rqmok View Post
    thanks medsont

    I am using MDI Tabcontrol that's why it doesn't let the form's background come through and I can't drag the form via the tabcontrol's backcolor area

    I could put on simple tabcontrol but the problem is that I can't change the shape of the tabs and I don't know how to add an 'x' for closing the tab

    thanks guys
    try this. it allows you to drag the form, TabControl1,tabpage1, + tabpage2

    vb Code:
    1. Public Class Form1
    2.  
    3.     Public Const HT_CAPTION As Integer = &H2
    4.     Public Const WM_NCLBUTTONDOWN As Integer = &HA1
    5.  
    6.     Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove, TabControl1.MouseMove, TabPage1.MouseMove, TabPage2.MouseMove
    7.         If e.Button = Windows.Forms.MouseButtons.Left Then
    8.             DirectCast(sender, Control).Capture = False
    9.             Me.WndProc(Message.Create(Me.Handle, WM_NCLBUTTONDOWN, CType(HT_CAPTION, IntPtr), IntPtr.Zero))
    10.         End If
    11.     End Sub
    12.  
    13. End Class
    Last edited by .paul.; Oct 18th, 2011 at 04:29 AM.

  12. #12
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: Move VB 10 Border less Form

    HTML Code:
    good answer, ............
    thank you...

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Oct 2011
    Posts
    121

    Re: Move VB 10 Border less Form

    Thanks Guys! Now anyone mind telling me how to mark this as resolved? sorry I am new to this

  14. #14
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,144

    Re: Move VB 10 Border less Form

    to the right above the 1st post, click Thread Tools-->Mark Thread Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width