?
Solved

How to OLE drag-n-drop a frame on a form?

Posted on 2006-04-17
1
Medium Priority
?
355 Views
Last Modified: 2010-08-05
Can I use the ole properties to enable drag and drop of a frame to a differnet position on a form? Will the frames controls travel nicely with it?
0
Comment
Question by:mccainz2
1 Comment
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1000 total points
ID: 16472374
You don't need OLE for that...

Option Explicit

Private startX As Single
Private startY As Single

Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
        startX = X
        startY = Y
    End If
End Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
        Frame1.Left = Frame1.Left + (X - startX)
        Frame1.Top = Frame1.Top + (Y - startY)
    End If
End Sub
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question