Results 1 to 1 of 1

Thread: drag and drop picture inm msflexgrid, from cell to other cell...

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    drag and drop picture inm msflexgrid, from cell to other cell...

    possible to drag and drop picture from a cell of msflexgrid, to the same msflexgrid in other cell...?

    found on this forum:

    Code:
    Option Explicit
    Dim strDragText As String
    Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    
        If Button = vbLeftButton Then
            With Me.MSFlexGrid1
                'set the current cell - it does not change on a rightmouse click
                .Row = .MouseRow
                .Col = .MouseCol
                .Drag vbBeginDrag    'start a drag operation.
                strDragText = .Text    'store contents that will be dropped
            End With
        End If
    
    End Sub
    Private Sub MSFlexGrid1_DragOver(Source As Control, x As Single, y As Single, State As Integer)
    
        If Source Is Me.MSFlexGrid1 Then
            MSFlexGrid1.Col = MSFlexGrid1.MouseCol
            MSFlexGrid1.Row = MSFlexGrid1.MouseRow
    
        End If
    End Sub
    Private Sub MSFlexGrid1_DragDrop(Source As Control, x As Single, y As Single)
    
        If Source Is Me.MSFlexGrid1 Then
            With Me.MSFlexGrid1
                .TextMatrix(.MouseRow, .MouseCol) = strDragText
            End With
        End If
    
    End Sub
    but instaed to drag the txt io need to drag a picture in a cell...

    i insert a picture in the msflexgrid cell with:
    Code:
    ...
    Set .CellPicture = Me.ImageList1.ListImages(1).Picture
    .CellPictureAlignment = flexAlignCenterCenter
    ...
    Last edited by luca90; Sep 25th, 2021 at 04:26 AM.

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