Results 1 to 3 of 3

Thread: Move form without Titlebar. no API needed

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    10

    Move form without Titlebar. no API needed

    Easily move form without using titlebar(border style=0) or you can click anywhere on the form to move it!!!.

    Code:
    Dim xx As Single
    Dim yy As Single
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        xx = X
        yy = Y
    End Sub
    
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then
            With Me
                .Left = .Left - (xx - X)
                .Top = .Top - (yy - Y)
            End With
        End If
    End Sub
    I found no drawbacks. Do you see anythig? .Please tell me
    Attached Files Attached Files

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Move form without Titlebar. no API needed

    Quote Originally Posted by nidhin.net View Post
    I found no drawbacks. Do you see anythig? .Please tell me
    A couple
    1. If form scalemode is not Twips, it won't work correctly

    2. If user hits Escape key, nothing will happen. Normal behavior during a move is that when Escape is hit, the moving object will snap back to original starting position and dragging stops, even if mouse button is still down.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    10

    Re: Move form without Titlebar. no API needed

    Thanks for your comment.

    I am very new to programming. I need the help from experts like you, to become an expert.

Posting Permissions

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



Click Here to Expand Forum to Full Width