Drag and drop selected item from listbox into TeeChart
Drag and drop selected item from listbox into TeeChart
Hello!
Could someone provide me an example how to drag and drop one selected item from ListBox onto TeeChart.
It seems that TeeChart does not support OLEDragDrop method and OnDragDrop is triggered only if I drop the ListBox itself onto TeeChart. And that's not I want.
My need is drop only selected item's text onto TeeChart. How could this be done?
-Pekka-
Could someone provide me an example how to drag and drop one selected item from ListBox onto TeeChart.
It seems that TeeChart does not support OLEDragDrop method and OnDragDrop is triggered only if I drop the ListBox itself onto TeeChart. And that's not I want.
My need is drop only selected item's text onto TeeChart. How could this be done?
-Pekka-
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Pekka!
Sure, you can try something similar to the following:Could someone provide me an example how to drag and drop one selected item from ListBox onto TeeChart.
Code: Select all
Private Sub Form_Load()
With List1
.AddItem "Banana"
.AddItem "Kiwi"
.AddItem "Orange"
End With
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.Drag
End Sub
Private Sub TChart1_DragDrop(Source As Control, X As Single, Y As Single)
TChart1.AddSeries scLine
TChart1.Series(TChart1.SeriesCount - 1).FillSampleValues 10
TChart1.Series(TChart1.SeriesCount - 1).Title = Source
TChart1.Legend.LegendStyle = lsSeries
End Sub
Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
' Change pointer to no drop.
If State = 0 Then Source.MousePointer = 12
' Use default mouse pointer.
If State = 1 Then Source.MousePointer = 0
End Sub
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
It works but...
Thanks for the example.
It does exactly what I want but there's one "cosmetical" issue:
When I start to drag selected item a gray frame of the listbox seems to be dragged not selected item.
It does not look good if I want visualize one item to be dragged from the listbox into TeeChart.
Is it possible to change mouse cursor when dragging is started and hide the drag frame of the listbox?
-Pekka-
It does exactly what I want but there's one "cosmetical" issue:
When I start to drag selected item a gray frame of the listbox seems to be dragged not selected item.
It does not look good if I want visualize one item to be dragged from the listbox into TeeChart.
Is it possible to change mouse cursor when dragging is started and hide the drag frame of the listbox?
-Pekka-
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Pekka,
I'm afraid not, this seems to be the Visual Basic behaviour.
I'm afraid not, this seems to be the Visual Basic behaviour.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi,
this feature is not implemented in the TeeChart Pro ActiveX. I've added it on our wish list to be considered for the next releases.
this feature is not implemented in the TeeChart Pro ActiveX. I've added it on our wish list to be considered for the next releases.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hello again.
It's ok to me to use plain DragDrop method. But still I want nice and clean visualizing of one item drag from listbox into teechart. It's soo ugly to drag and drop gray frame of the listbox...
Does anyone know a trick/workaround/something to hide drag frame from listbox and change mouse cursor to visualize item dragging?
-Pekka-
It's ok to me to use plain DragDrop method. But still I want nice and clean visualizing of one item drag from listbox into teechart. It's soo ugly to drag and drop gray frame of the listbox...
Does anyone know a trick/workaround/something to hide drag frame from listbox and change mouse cursor to visualize item dragging?
-Pekka-
AAAAA ! I got it! It seems that when object's DragIcon is not defined a gray frame is displayed when dragging the object. When I defined an icon for object's DragIcon property no drag frame was displayed and mouse cursor was changed to icon I wanted.9082336 wrote:Hello again.
It's ok to me to use plain DragDrop method. But still I want nice and clean visualizing of one item drag from listbox into teechart. It's soo ugly to drag and drop gray frame of the listbox...
Does anyone know a trick/workaround/something to hide drag frame from listbox and change mouse cursor to visualize item dragging?
-Pekka-
So case is now closed.
Thanx for your support guys!
-Pekka-
Hi Pekka,
usign the same code for the formB should work fine :
Code FormA
Code FormB
usign the same code for the formB should work fine :
Code FormA
Code: Select all
Private Sub Form_Load()
With List1
.AddItem "Banana"
.AddItem "Kiwi"
.AddItem "Orange"
End With
Form2.Show
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.Drag
End Sub
Private Sub TChart1_DragDrop(Source As Control, X As Single, Y As Single)
TChart1.AddSeries scLine
TChart1.Series(TChart1.SeriesCount - 1).FillSampleValues 10
TChart1.Series(TChart1.SeriesCount - 1).Title = Source
TChart1.Legend.LegendStyle = lsSeries
End Sub
Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
' Change pointer to no drop.
If State = 0 Then Source.MousePointer = 12
' Use default mouse pointer.
If State = 1 Then Source.MousePointer = 0
End Sub
Code: Select all
Private Sub Form_Load()
With List1
.AddItem "Banana"
.AddItem "Kiwi"
.AddItem "Orange"
End With
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.Drag
End Sub
Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
' Change pointer to no drop.
If State = 0 Then Source.MousePointer = 12
' Use default mouse pointer.
If State = 1 Then Source.MousePointer = 0
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com