CUT AND PASTE PICTURE FROM MSFLEXGID
CUT AND PASTE PICTURE FROM MSFLEXGID
(OP)
not for me...
possible to cut picture from a msflexgrid cell and paste in other cell, with left click button of mouse?
possible to cut picture from a msflexgrid cell and paste in other cell, with left click button of mouse?
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
PS. And why do you use 2 login names?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
no idea to create code for drag and drop, never used
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
CODE -->
Option Explicit Dim drgImage As Picture Dim srcRow As Long Dim srcCol As Long Private Sub Form_Load() ' Set up a trivial msflexgrid with an image from an imagelist MSFlexGrid1.Rows = 4 MSFlexGrid1.Cols = 4 MSFlexGrid1.Row = 3 MSFlexGrid1.Col = 3 Set MSFlexGrid1.CellPicture = ImageList1.ListImages(1).Picture End Sub 'MSFlexgrid DragMode property should be 0 - vbDragManual. Generally this is the default. Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = vbLeftButton Then With Me.MSFlexGrid1 If .CellPicture <> 0 Then .DragIcon = .CellPicture ' capture source cell info Set drgImage = .CellPicture srcRow = .Row srcCol = .Col .Drag vbBeginDrag 'start a drag operation. End If End With End If End Sub Private Sub MSFlexGrid1_DragOver(Source As Control, x As Single, y As Single, State As Integer) ' Allow default control behaviour to highlight potential target cell 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 Set .CellPicture = drgImage ' copy source image into target .Row = srcRow .Col = srcCol Set .CellPicture = Nothing ' this is a cut and paste, so delete image in source cell ' Rehighlight cell we dropped on as that is generally expected behaviour .Row = .MouseRow .Col = .MouseCol End With End If End Sub
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
but i cannot test now.
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
thread222-1814206: OPEN TXT AND SAVE TO UTF8
thread222-1814146: select range of cell and clear all
thread222-1813837: possible to intercept the row and column on msflexgrid without to use the mousemove event
thread222-1813768: find in a collection
all fairly recent threads started by you that have been left hanging. Appreciate that you may be busy, but so are the people who provide help here, and the repeated behaviour of asking questions, and then leaving them open (in the sense that we have no idea if you have seen the help, whether the help was of any use, or no response to questions seeking additional info from you) gives the appearance that you think your time is more valuable than our time.
And once people begin to get that impression, the less likely they will be to carve out some of their own valuable time to help you out. Just saying.
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
Have you ever seen this?
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
only one...
have error in : .DragIcon = .CellPicture
but i have commented the line in error and work!
Tks
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
Set .DragIcon = .CellPicture
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
see image
when click on image, error in Set .DragIcon = .CellPicture
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
You can fix this by changing
Set MSFlexGrid1.CellPicture = ImageList1.ListImages(1).Picture
to
Set MSFlexGrid1.CellPicture = ImageList1.ListImages(1).ExtractIcon
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
Tks
RE: CUT AND PASTE PICTURE FROM MSFLEXGID
mintjulep may be right...
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson