Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag from FlowChartX to another component (Read 3956 times)
baron
YaBB Newbies
*
Offline


1001001001

Posts: 42
Joined: Dec 2nd, 2007
Drag from FlowChartX to another component
May 10th, 2012 at 3:19pm
Print Post  
I've been trying to find a way to drag from FlowChartX into another component with custom data for several hours now without success.

The goal is to be able to drag a Box into another VB6 ActiveX component in another window, and to be able to extract custom data specific to this Box from this drag&drop action.

Thanks in advance for any pointers - no need for full code, just a list of steps I need to take would help...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag from FlowChartX to another component
Reply #1 - May 11th, 2012 at 6:44am
Print Post  
This seems to work -

Code
Select All
Private Sub fcx_MouseDown(ByVal button As FLOWCHARTLibCtl.EMouseButton, ByVal keys As Integer, ByVal docX As Long, ByVal docY As Long)
    If Not keys = vbShiftMask Then Exit Sub

    Dim b As box
    Set b = fcx.GetBoxAt(docX, docY)
    If Not b Is Nothing Then
        Dim dataObj As MSForms.DataObject
        Set dataObj = New MSForms.DataObject
        dataObj.SetText b.UserString, vbCFText
        dataObj.StartDrag
    End If
End Sub 

  
Back to top
 
IP Logged
 
baron
YaBB Newbies
*
Offline


1001001001

Posts: 42
Joined: Dec 2nd, 2007
Re: Drag from FlowChartX to another component
Reply #2 - May 13th, 2012 at 9:02am
Print Post  
We can't use MSForms. It isn't redistributable and may not exist on the target computer.
  
Back to top
 
IP Logged
 
baron
YaBB Newbies
*
Offline


1001001001

Posts: 42
Joined: Dec 2nd, 2007
Re: Drag from FlowChartX to another component
Reply #3 - May 13th, 2012 at 1:26pm
Print Post  
OK in case anyone is interested, I solved this as follows:

I detected a mousemove with the button pressed on the flowchart control, saved the current box info into a variable during this mousemove event, then initiated an OLEDrag on the parent control containing the chart, and handled the OLEStartDrag event on the parent control.

If anyone has a better idea or thinks this approach may have problems, please let me know.

Thanks for your help.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint