Dragdrop Moving Wrong Item In Listbox(aborted Dragdrop Idea)
I am using dragdrop in a list box(checkbox style) to move items around but sometimes it picks up the item below the one I selected instead of the one I clicked on. ANy ideas? heres the code I'm using
Code: Private Sub lstFields_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If (Button And vbLeftButton) = vbLeftButton Then nDragIndex = Y Me.TextHeight("Xyz") If nDragIndex >= 0 And nDragIndex < lstFields.ListCount Then blnDraging = True End If End If End Sub
Private Sub lstFields_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim nIndex As Integer Dim sItem As String If (Button And vbLeftButton) = vbLeftButton Then If blnDraging = True Then nIndex = Y Me.TextHeight("Xyz") If nIndex > lstFields.ListCount - 1 Then nIndex = lstFields.ListCount ElseIf nIndex < 0 Then nIndex = 0 End If If nIndex <> nDragIndex Then sItem = lstFields.List(nDragIndex) lstFields.RemoveItem nDragIndex lstFields.AddItem sItem, nIndex End If End If blnDraging = False End If End Sub
This is my first post with code in it so I hope I did it right, sorry if I didn't.
Sunflower Queen
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Get DragDrop Items.Index Or Item(Name) On ListView With Scrollbar?
Hiya's folks
Here's my bug
Code:
Private Sub lstView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, _
Button As Integer, Shift As Integer, X As Single, Y As Single)
myIndexItem = lstView1.ListItems.Item(Int(Y / 17) + 1)
End Sub
I'm using this statement to get the item name, but when the V-scrollbar is scrolled down...
I can't get the good item since I'm using the Y parameter
Any idea how to get the index of the first item displayed in listview when
the scrollbar is scrolled?
Or is there a way to get the "visual" name of the item I drag on?
Thx!!
DragDrop In Listbox
I have a listbox with several items. I want to allow the user to change the order of these items with drag and drop.
How do I do that? (I never used drag and drop in my progams)
ListBox DragDrop Question
Since 30 minutes, I am working with a listbox to try to made it working as I wanted. I simply want to click and drag the line in an other position in my listbox. The problem is than I didn't find how it work. Any of you can help me ? Thx you in advance
Listbox Dragdrop - Display Filename
I have a listbox. I want it to display just the file name and not the whole location when I drag and drop files. What do I do?
Eample:
now its shows "D:PicturesGarden.jpg"
I want it to show "Garden"
im using:
VB Code:
Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)' change ole drop mode to manual If Data.GetFormat(15) Then Dim cnt As LongFor cnt = 1 To Data.Files.CountList1.AddItem Data.Files(cnt) Next cntEnd IfEnd Sub
DragDrop
Anyone here knows how I can drag a file onto my VB app and it detects the whereabouts of this file and then takes some action?
DragDrop
Hi my names Phil. As I have only been Learning VB for about 3 hours I have simple question which I hope someone may be able to solve.
I am trying to Drag and Drop a command button around the screen using the following code
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
'Source.Left = X
'Source.Top = Y
End Sub
However as you can probaly tell when I drop the object the left hand corner goes to where the mouse pointer is.
What I want to be able to do is make the center of the button go to where the cursor is.
Is this possible without using API's as I don't really want to get into them just yet.
Thanks People Phil
DragDrop
Can anyone explain me the way it is to dragdrop text from a listbox to a textbox, I just don't know how to do it... thanx
OLE DragDrop
I'm having real problems getting OLDDragDrop event to work on the Listview control. I'm running VB6 with Service Pack4 installed.
the variables that go with the event start with
Data as MScomctlLib.DataObject
I can see from the object browser that MScomctlLib is available and does include DataObject.
However.... when the program runs and a use a breakpoint in the sub to check the variables they are all populated except for 'Data' which should be of the type MScomctlLib.DataObject.
The program bombs saying that the object type is not supported ! I can't remove the word MScomctlLib, just leaving DataObject and nothing I do seems to make this work.
'Data' should be populated with details of what I am dragging and dropping onto the Listview control. Can anybody please help me as this is driving me mad and holding an important part of a project up.
Thanks
WMP & DragDrop
I can get drag and drop to work normally with other items, but I can't seem to get it to work with the Windows Media Player Control. Any Suggestions?
DragDrop
Is it possible to show the text(Caption) of a label while dragging that label, if so, HOW?
DragDrop
Hi,
after I used a Drag on a Control, I see an empty frame waiting to be droped
. Ok, then I use the dragdrop method, but there are x and y parameters,
representing the mouses position. But I want to drop on the position, where I
see the empty frame of the control.
Where are these coordinates ???
Thanx and regards
Stephan
DragDrop Dilema
Hello,
Well it would appear I have a new dilema. I am working with the DragDrop function, mainly because it's something I have little experience in and would like more of. For my experience, I created a form where the user would drag an image to a picturebox. When the user drops the image, the picturebox would then display the image in the picturebox.
I have the image being used for this set to "Automatic" in the DragMode property. Unfortunately I am unaware of how to cause the picturebox to display the image once it has been "dropped". How would I go about this exactly? I thank you all in advance.
ListView - DragDrop
Hi,
I have some problems implementing OLE Drag and Drop in a ListView.
I want to use Drag and Drop to order items manually. To do so I need to now where I Drop the drag (which item...) I use HitTest(x,y) to know where my cursor is, but I think it is all messed up...
OLEDragOver, OLEDragDrog returns X and Y as single but HitTest don't seem to use the same references... (Pixels, Twips,... )
Need help...
DragDrop Outline
Is there any way to move a actual source image when using DragDrop instead of just having an outline move? If not, then what other method(s) is used to do this?
***EDIT***
After more searching, I think I need to add more data. The images I want to move are .jpg format. I think this means that I can't use the Auto DragMode/DragIcon, correct? If so, is there any way I can use a Manual method with a .jpg DragIcon?
MSHFlexGrid DragDrop
Tia,
I have two MSHFlexGrids on my form and I would like to drag the contents of a cell in one to the other.
Thus far I have tried setting DragMode to Auto, but that disables the ability to select a cell.
I have also manually performed the drag, but the mouseup event occurs on the source control not the destination and the destination control does not 'see' the mouseover (so I can't seem to tell where the drop occurs).
Anyway, I feel like I'm on the wrong track. Any pointers would be appreciated.
DragDrop From Outlook
Hi guys ! I have a rather tough one for you today. What I want to do is to be able to DragDrop mail Objects (.eml) from Outlook Express (or Outlook) to my App's ListView. I searched your website and find some interesting things but the problem is the ComctLib.DataObject (Data parameter of the OLEDragDrop event) don't support ".eml" files. I get an error : " Error 461 Specified format doesn't match format of data" Do you have any suggestion on how should I proceed ?
Hooking DragDrop
OK I posted this question before but never got exactly what I was looking for and settled for a work around which is a little cowboyish to say the least, I have a webbrowser and a DHTMLEdit control and I want to intercept drag drop events from the browser to the DHTMLEdit the problem being there is no events in either of these controls to tell you when this happens
I know the basics of subclassing but on all the sites I have searched have not found the Windows Message for dragdrops, if anybody can tell me this I would be very grateful
DragDrop Between UserControls
Any help on this would be appreciated.
I created a UserControl with a TreeView, FlexGrid, labels, buttons, etc. DragDrop is enabled on the TreeView of the UserControl. When I enter dragmode in the TreeView, the dragicon is visible only within the boundaries of the UserControl. If I try to drag outside the boundaries of the UserControl I get a dragicon which is a circle with a line through it.
However, what I want to do is put multiple instances of the UserControl on a single form and drag a node from one instance of the UserControl to another instance of the UserControl.
Any ideas on how to do this in VB5?
DragDrop Question...
I figured this out easy enough...
Code:
Private Sub Cell_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Cell(Index).Picture = Source.Picture
Source.Picture = Nothing
End Sub
Is there a way to make the image move with the mouse when you start the drag? So it looks like your phisically moving the image?
Ole DragDrop Source
Hi, id like to know if there is a way to get the source object when im using the oledragdrop. As with the usual dragdrop, the destination receive the source in parameter. but in oledragdrop its the object but im my case, i pass a node key im parameter cause i dont know how to set the data to pass the all treeview. so if somebody have an idea let me know
thanks
Open DragDrop
how can i set a textbox so when a user drags a text file into it it will open the text file in the textbox?
How Can I DRAGDROP A LINE??
hi,
i know that a line doesnt have the DRAGDROP property!!
but what i want here is , is there a way to drag and drop the line at run time?? and how to do it??
so please please give a help... i really need it!!
DragDrop Probelm
I am making an MDI which mimics the functions of VB IDE to a certain extent. I have a child form which I add controls to (textboxes, labels, buttona etc). I have code to allow the user to move the controls in the form. However when the user moves the control the top-left corner of the control jumps to where the mouse cursor is. I know that this is because of the offset, but I have allowed for this. I do though set the control's DragMode to Automatic - i also know that this has to be set to manual for the MouseDown, MouseUp etc events to be picked up, but if I set the controls DragMode to Manual I am not able to move the controls
Here is the code to add the control
Code:
Set cmdControl = ActiveForm.Controls.Add("VB.CommandButton", gloButtonName)
With cmdControl
.Caption = gloButtonName
.DragMode = 1
.Visible = True
End Width
Here are my methods in the child form
Code:
Private pMoving As Boolean
Private pStartX As Single
Private pStartY As Single
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
pMoving = True
pStartX = X
pStartY = Y
Command1.Drag
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If pMoving Then
Call Command1.Move(Text1.Left + (X - pStartX), Text1.Top + (Y - pStartY))
End If
End Sub
Private Sub Form_DragDrop(Command1 As Control, X As Single, Y As Single)
Command1.Left = X - pStartX
Command1.Top = Y - pStartY
pMoving = False
End Sub
Any help would be appreciatated as this has been bugging me for months.
DragDrop Probelm
I am making an mdi.
The parent form has the following code
Code:
Private Sub tbAwtBar_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim c As Integer
Dim pControl As Control
Dim ActiveFormName As String
If (ActiveForm Is Nothing) Then LoadNewDoc
ActiveFormName = ActiveForm.Caption
Select Case Button.Key
Case "Button"
gloButtonCnt = gloButtonCnt + 1
gloButtonName = "Command" & gloButtonCnt
Set pControl = ActiveForm.Controls.Add("VB.CommandButton", gloButtonName)
With pControl
.Caption = gloButtonName
.DragMode = vbManual
.Visible = True
End With
'For c = 1 To gloDocumentCount Step 1
' recurse through document array to find document.name = to Activeformname
'If documentDetail(c).formName = ActiveFormName Then
Case "Label"
gloLabelCnt = gloLabelCnt + 1
gloLabelName = "Label" & gloLabelCnt
Set pControl = ActiveForm.Controls.Add("VB.Label", gloLabelName)
With pControl
.Caption = gloLabelName
.Left = 1200
.Top = 1200
.DragMode = 1
.Visible = True
End With
Case "TextBox"
gloTextboxCnt = gloTextboxCnt + 1
gloTextboxName = "TextBox" & gloTextboxCnt
Set pControl = ActiveForm.Controls.Add("VB.TextBox", gloTextboxName)
With pControl
.Text = gloTextboxName
.Left = 1200
.Top = 1600
.Visible = True
.DragMode = 1
End With
Case "TextField"
End Select
End Sub
I want to be able to move the controls on the child form at runtime
The child form has the following
Private Xoffset As Single
Private Yoffset As Single
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Xoffset = X
Yoffset = Y
Command1.Drag vbBeginDrag
End If
End Sub
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - Xoffset
Source.Top = Y - Yoffset
End Sub
However if the dragmode of the command button is manual this doesn't work and i can't drag the button. If it is automatic then i can drag but then i can't use MouseDown so the initial X,Y values of the mouse are not stored.
Any suggestions? Do I need to install dragdrop for manual usage?
Also i will be creating other command buttons on the child form i.e Command2, Command3 etc. Will the Command1_MouseDown and other events work for the other buttons?
Dragdrop With Image In The Way...
How do i get a picturebox to notice a dragdrop event when there's an image control in the way? Is there some ridiculously simple answer to this question or do i have to keep track of x and y coordinates and go through the imagecontrols dragdrop event? I'd rather not if it is possible to avoid it.
Help: Picture DragDrop
I have seen a few programs where the user is able to pick up a image that's on the form and drop it in a new location on the form where it will stay.
Also is there away of saving the location of the drag dropped image so it is able to be loaded onto its last location at the next execution. I now how to do this with external files containing the co-ordinates (such as a text file) but I've heard that you can do it within the program without any external files.
I have know idea how to do this and it would be really cool if someone could help me...
DragDrop Question
hi, i am trying to drag two images and then change there images....how would i loop this code so it only drags one image, at the moment it drags both on them on the image2 and only the one asked for on image1, here is my code
Code:
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X, Y
Dim image As Integer
image = 1
If image = 1 Then
Image1.Visible = False
image3.Visible = True
Else
Image2.Visible = False
image4.Visible = True
End If
End Sub
thanx for your help
DragDrop On Own Control
I have two listviews and I don't want the user to be able to drop data onto it's original listview control.
How Can I stop this?
Thanks
ListView DragDrop
I have a ListView on one of my forms, its setup as a report view for multiple reasons i wont get into here..
What im trying to do is make it so that the user can select an item, and drag and drop it into a multi-line text box, and it will display the text in the text box from the first column of the item they dragged over.
The problem is, when the user does this, it removes the item from the ListView.. Is there a way to make it automatically copy the item instead of moving it?
All i did to setup the drag and drop is change the OLEDragMode of the ListView to Automatic, and the OLEDropMode of the text box to Automatic...
Ive never used drag and drop before so im kinda clueless...
Limiting OLE DragDrop
I have a form. I'm using the OLE drag drop function. What I want to do is limit to only 10 objects that can be dropped to the form.
What are the codes to use to disable the objects from being dropped to the form if more than 10 have been selected?
Using The Dragdrop In A Picturebox
hi, i made a topic for this inside another, but decided to make a separate topic...
anyway i have 4 picture boxes which are used for one purpose, and 8 other picture boxes for another purpose
anyway what i want to do is, when i drag one of the 8 pictureboxes it will store the name of the object and then when it is placed in one of the 4 other boxes it will create the corresponding image
Private Sub pic_emptyslot1_DragDrop
pic_emptyslot1.Picture = Selected.Picture
End Sub
Public Sub Pic_temp1_Click()
Set Selected = Pic_temp1
End Sub
when i run these two codes, it says that the object is not set (it is called as a variable prior to this) if i call somewhere else that Set Selected = Pic_temp1 it will actually work, but the click event isnt working,....
has this got somthing to do with private and public? can someone give me a reply? i would be appreciative.
Trouble Of DragDrop
Hi,
I have a question that I found hard to express:
We can enable a textbox's OLEdragdrop by setting it's DragMode=1, and actually I have made it. But it can only receive the source such as picturebox, command button, listbox...which are in the same form as the textbox. I tried to drag a file on the desktop to a textbox, hoping that it can open the file, but failed. But, I can drag a file(html) to IE and open it. Please tell me how to do that, thanks.
in addition, I remember a software named "MyIE", which has a small "basket" (infact,it is a form of small sizes). When you drag text from a web, it can save the text to a specific file. How can it receive the text?
I hope of this thread not too prolix.
DragDrop Web Image...
How can I drag an image off of IE (webpage) onto my form and have it display in a picturebox?
thanks!
[EDIT](I did try and cant seem to get it to work) lol[/EDIT]
DragDrop To TrueDBGrid7.0
Hello! Please help me.
I need to drag an item from a list box from one form to a
TrueDBGrid column of another form. The listbox can select only one row at a time.
Help!
Thanks!
DragDrop Procedures
Can someone please help me? I have a form with two picture boxes, picDragDrop1 and picDragDrop2. I have an image in both (the same image) but in picDragDrop1 it is visible and in picDragDrop2 it is not visible.
I am trying to code the dragdrop and dragover procedures so that:
1) when the picture is dragged out of the first picture box and is dropped on the form, it appears to "snap" back into the first picture box
2) when the picture is dragged out of the first picture box and is dropped onto the second picture box, it appears in the second picture box but vanishes from the first (i.e. as if it "moved")
3) when the picture is dragged within the first picture box or is dragged around anywhere on the form but then dropped back onto the first picture box, it reappears in the first picture box as it originally was.
I am having trouble only with this last part (part 3). When I drop it back onto the first picture box it vanishes completely. Why is this? Here is the code I have so far:
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
picDragDrop1.Visible = True
End Sub
Private Sub picDragDrop1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
picDragDrop1.Visible = False
End Sub
Private Sub picDragDrop2_DragDrop(Source As Control, X As Single, Y As Single)
picDragDrop2.Picture = Source.Picture
End Sub
DragDrop Troubles
Hi there!
I have a kind of tricky problem (or I'm simply to dumb )
I want to move a control around my form. To put my Button
on the right place after the drop I save the mouse-offset.
Code:
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button = vbLeftButton) Then
m_sX = X
m_sY = Y
Command1.Drag vbBeginDrag
End If
End Sub
If for example I start the Drag in the lower right corner of
the MousePointer stays in the same relative position to the
Drag-Rectangle when I move around the Form.
So far so good.
However sometimes the MousePointer moves to the center of the Drag-Rectangle after the BeginDrag
(about once in 15 attempts). In this case my DragDrop function doesn't put the Button in the right place.
This is not good.
Code:
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
With Source
.Left = X - m_sX
.Top = Y - m_sY
End With
End Sub
Thanks in advance for any advice.
best regards
da_bob
____________________
DragDrop With Two Listboxes
In my Program there are two listboxes.
Now I want to select one item of the first listbox and
then move it to the second listbox with the mosue.
While moving the item the mousepointer should be an icon
like one from DRAGDROP.
Is this possible in VB 3.0 ?
Thanks for some advice, Matt
Dragdrop With A Listview
I've got a listview in report mode (it's a small table, really), and I want the user to be able to change the order of the rows. They should be allowed to click on row 5, drag it up a ways, and drop it between rows 1 and 2 (those are arbitrary numbers). All I want is to allow dragdrop support to the report mode of the listview, but it's eluding me.
Thanks in advance,
bob
Dragdrop To Explorer
How do I dragdrop something to explorer.
For example:
I have a listbox on a form.. In this list box are filenames.
(Hello.txt).
When I click this item in the listbox and drop it to the desktop I want the program to make a file named 'Hello.txt'.
How do I do this??
Dragdrop UserControl
Hi:
I have a form with a picture box and some command buttons to make
certain shapes appear in the picture box. The shapes are drawn on
blank UserControls added like this:
'at top of form module
Dim WithEvents tc As testControl
'button1_click (for example)
Set tc = Controls.Add("testproj.testControl", "tc[index]",
Form1.Picture1)
(then shapes are drawn on the control and it's added to a collection
of like shapes)
My idea was to have these UserControls store internally some data that
would enable them to interact, most importantly to implement dragdrop
operations so that one control dragged over a "hot spot" in another
control would site itself at that spot, after some validation.
Here's where I'm stuck: I've found example after example explaining
how to convert a point on one object to a point in its container, but
none of them have worked so far. I'm wondering if this is a result of
creating the UserControls at run-time? Specifically, here is what I
would like to happen, but can't pull it off:
When the shapes are drawn on the control, certain points are captured
as hot spots and stored in a read-only array. These coordinates remain
in the control's own scale and are not converted.
When one control is dropped onto another, the dragdrop event fires,
and I can confirm the source is at a point inside the target control.
I want to compare this point to the internally stored points of target
and select the closest hot point. Then I need to convert that hot
point to the picture1 coordinates and move the source control there.
This seems like it should be a piece of cake, but it's been driving me
crazy for almost a day now. Any help would be appreciated, thanks in
advance.
OLE DragDrop From Outlook
I'm looking to drag an outlook email item to a listview, and have only had success viewing the details of the file being dropped and not the content. Is there any way to access the content of the message?
I would prefer doing this with OLE DragDrop only rather than having to use any Outlook COM components (if that is even possible).
Any help would be greatly appreciated.
Thanks.
DragDrop Problem
I have an applictions and i want to drag a file to a text box and the file path show up in it when it is droped. WHen i drag over the box there the crossed out icon. What do i need to do to make this work. Thanks in advance
Treeview DragDrop
Can anyone tell me how to move text from a textbox to make it a parent node using a click event on a treeview. For example: I put text in a textbox, then do a drag/drop event from text box to the clear white space of a treeview. And if selecteditem is nothing, then make the text a parent in the treeview. If selecteditem is a node (either a parent or child), then put in in the treeview accordingly. The problem is, selecteditem is never nothing, it is in most cases the first item the treeview. How can I solve this problem??
DragDrop In MSFlexGrid
I have a form with an MSFlexGrid and a PictureBox control on it. I am using this form as a test to teach myself how to do drag and drop. I can get the drag to work properly, but when I drop the picture box, the information I am dropping doesn't get dropped where I tell it to. Here is the code I have:
option Explicit
Dim iColSel as Integer
Dim iEndCol as Integer
Dim iIndex as Integer
Dim iRowSel as Integer
Dim iSelCol as Integer
Dim iSelRow as Integer
Dim iStartCol as Integer
private Sub Form_Load()
Dim iCol as Integer
for iCol = 1 to 4
grdTest.TextMatrix(2, iCol) = "Corey"
grdTest.Row = 2
grdTest.Col = iCol
grdTest.CellBackColor = vbCyan
next iCol
grdTest.MergeRow(2) = true
End Sub
private Sub grdTest_DragDrop(Source as Control, x as Single, y as Single)
If iColSel + (iEndCol - iStartCol + 1) > grdTest.Cols - 1 then
MsgBox ("You can't drop that here!")
Exit Sub
End If
for iIndex = iColSel to (iEndCol - iStartCol)
grdTest.TextMatrix(iRowSel, iIndex) = grdTest.TextMatrix(iSelRow, iSelCol)
grdTest.Row = iRowSel
grdTest.Col = iIndex
grdTest.CellBackColor = Picture1.BackColor
next iIndex
grdTest.MergeRow(iRowSel) = true
for iIndex = iStartCol to iEndCol
grdTest.TextMatrix(iSelRow, iIndex) = ""
grdTest.Row = iSelRow
grdTest.Col = iIndex
grdTest.CellBackColor = vbWhite
next iIndex
End Sub
private Sub grdTest_MouseDown(Button as Integer, Shift as Integer, x as Single, y as Single)
iSelCol = grdTest.ColSel
iStartCol = iSelCol
iSelRow = grdTest.RowSel
Do Until grdTest.TextMatrix(grdTest.RowSel, iSelCol) <> grdTest.TextMatrix(grdTest.RowSel, iStartCol - 1)
If iStartCol - 1 = 0 then
iStartCol = iStartCol - 1
Exit Do
End If
iStartCol = iStartCol - 1
Loop
iEndCol = iStartCol
Do Until grdTest.TextMatrix(grdTest.RowSel, iSelCol) <> grdTest.TextMatrix(grdTest.RowSel, iEndCol + 1)
If iEndCol + 1 = grdTest.Cols - 1 then
iEndCol = iEndCol + 1
Exit Do
End If
iEndCol = iEndCol + 1
Loop
grdTest.Row = grdTest.RowSel
grdTest.Col = iStartCol
Picture1.BackColor = grdTest.CellBackColor
Picture1.Height = grdTest.RowHeight(grdTest.Row)
Picture1.Width = grdTest.ColWidth(iSelCol) * (iEndCol - iStartCol + 1)
Picture1.Left = grdTest.Left + (grdTest.ColWidth(iSelCol) * iStartCol) + 10
Picture1.Top = grdTest.Top + (grdTest.RowHeight(iSelRow) * iSelRow)
Picture1.Drag
End Sub
What do I have to do to retrieve the MSFlexGrid column and row that the information is dropped into?
DragDrop Event
I have a Textbox named txt1.And 2 ListBox controls named lst1 and lst2.I have set the TabStop property value of the ListBox controls to False.And have set the DragMode property of txt1 to Automatic.I want to be able to type a name into txt1 and drag-and-drop the name into either lst1 or lst2.I need code statements for the DragDrop event for each Listbox control using the AddItem method for adding the Text from txt1 to the Listbox controls and then set the Text property of txt1 to "".Thanks
|