Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag and Drop with Frame Control

Status
Not open for further replies.

ufobaby

MIS
Sep 25, 2001
238
US
hi all,

I am trying to use Drag & Drop with Frame control in VB6.0 Below is the code is use. Somehow the frame gets placed at wierd places on the form. Frame Drag mode initally is Manual and Scale Mode for the Form is Twip.

'===========================================================
Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

Frame1.Drag 1
DragX = X
DragY = Y

Ens Sub

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)

Source.Move (DragY - Source.Width / 2), (DragX - Source.Height / 2)

End Sub
'===========================================================

I have gone thru examples of Drag & drop with Pic Boxes but that is somethig else.

Is the problem with moving controls because of the ScaleMode difference or what ???

Please Help.

Cheers !!!
Niraj >:):0>
 
Methinks there is something weird with the Frame control.
You can't set the Scalemode for a Frame.

I have a program where the Form Scalemode is vbPixels. There is a Frame with 3 Command buttons and a Webbrowser control on it. This frame is not visible until the mnuHelp is clicked - then I resize everything on the Frame and make it visible.

I expected that the Frame would inherit its Scalemode from the Form, pixels in this case. But it appears that I have to use twips for the resizing and relocating of some controls on the Frame and pixels for others.

I suspect you are getting mixed scaling units in your Drag-n-Drop calculations. You might try Debug.Print-ing the values and see if they make sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top