Results 1 to 2 of 2

Thread: Moving forms around a scree

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    25

    Moving forms around a scree

    Hi

    I am developing an Point of sale system . The forms do not follow conventional windows design as the caption bar is removed. At the top of the form is a frame with info about the form.

    The problem is that my app is an MDI form and the user needs toi be able to move windows around the form as they choose.

    normally, this would be done by selecting the caption bar of the form and dragging it to the new location. However if the form has no caption bar, then is there any other way by using API calls then the form could be moved around the screen by the user

    regards

    Mark

  2. #2
    Matthew Gates
    Guest
    You don't need API for this, use this code.


    VB Code:
    1. Dim prevX As Single, prevY As Single
    2.  
    3. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    4.     prevX = X
    5.     prevY = Y
    6. End Sub
    7.  
    8. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    9.     If Button = 1 Then Move Left - (prevX - X), Top - (prevY - Y)
    10. End Sub

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