Results 1 to 3 of 3

Thread: I was wonderig

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    Question

    Ok, I havent been able to get any of these functions to work. I put them in the said-to-put spots but nothing. How do you move a form w/o having a title bar?
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    Private Declare Function SystemParametersInfo Lib "User32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
    Private vX!, vY!
    Function SetWindowsDragStyle(ByVal FullDrag As Boolean) As Long
    Call SystemParametersInfo(37, CLng(FullDrag), 0&, 0)
    SetWindowsDragStyle = Err.LastDllError
    End Function
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        vX = X: vY = Y
    End Sub
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then Move ScaleX(X - vX, ScaleMode, vbTwips) + left, ScaleY(Y - vY, ScaleMode, vbTwips) + tOp
    End Sub
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    This is the code I use:

    Code:
    'Put in form declarations:
    Dim oldX As Long, oldY As Long, isMoving As Boolean
    
    'The following can be used in a picture, form, label, etc.
    
    Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    oldX = X
    oldY = Y
    isMoving = True
    End Sub
    
    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If isMoving Then
        Me.Top = Me.Top - (oldY - Y)
        Me.Left = Me.Left - (oldX - X)
    End If
    End Sub
    
    
    Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    isMoving = False
    End Sub

    This code will move a form easy and without the outline.

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