Page 1 of 1
DEL Key and List BOX
Posted: Mon Dec 20, 2004 10:40 am
by 9524648
Hi !
Does anyone knows if it is possible to prevent the user from pressing the keyboard's DEL key above a LisBox component ?
Indeed this key removes the selected serie of the Chart.
I wish the user could not delete any serie from the Chart.
So, I must catch the DEL key pressed EVENT but such an event doesn't exist...
If I could catch such an event, I could warn the user the pressing the del key will make the program to hang up.
Thanks for your help
Posted: Mon Dec 20, 2004 11:06 am
by Pep
Hi,
TeeListBox does not have a KeyDown event associated with it. The following boolean properties will be added for the next maintenance relesaes :
AskDelete
AllowDeleteSeries
AllowAddSeries
But it could be simulated using the following code, when run with a form with a small command button _underneath_ a TeeChart or TeListBox object :
Code: Select all
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
MsgBox KeyCode
End Sub
Private Sub Form_Load()
With TChart1
.AddSeries scArea
.Series(0).FillSampleValues (10)
End With
With TeeListBox1
.Chart = TChart1
.ShowIcon = False
End With
End Sub
Private Sub TeeListBox1_GotFocus()
Command1.SetFocus
End Sub
what about the properties planned to add ?
Posted: Mon May 02, 2005 9:19 am
by 9524648
Hi !
I can't find the properties you promised to me in the 7.0.0.4 release :
AskDelete
AllowDeleteSeries
AllowAddSeries
for the ITeeListBox component.
Where are they ?
thanks for your reply.
Posted: Fri May 06, 2005 7:21 am
by Pep
Hi,
you're correct. I'm sorry, I'll add them for the next v7.0.0.5 release.
Posted: Fri May 13, 2005 1:40 pm
by 9524648
Thanks !
I'm waiting the next release impatiently
.
bye.
Posted: Fri Nov 03, 2006 1:15 am
by 9527696
Hello Pep,
The following attributes have been added to the TeeListBox
AskDelete
AllowDeleteSeries
AllowAddSeries
ItemHeight
but it looks like we can only modify these at design time. There's no way to set these attributes during run time?
Thanks,
Jenn
Posted: Fri Nov 03, 2006 8:44 am
by narcis
Hi Jenn,
Have you tried doing this?
Code: Select all
With TeeListBox1
.Chart = TChart1
.AskDelete = True
.AllowDeleteSeries = True
.AllowAddSeries = True
.ItemHeight = 20
End With
Works fine for me here using
Insert and
Delete keys for adding and removing series.
Posted: Tue Nov 07, 2006 6:30 pm
by 9527696
Hello Josep,
I am using VC++, TeeChart Pro V7.0.1.2.
and I don't see how to modify the AskDelete, AllowDeleteSeries, and AllowAddSeries in the teelistbox.h file.
Is there something else I need to do when I update my TeeChart files to get the appropriate header files? I think I've done everything I need to do, but maybe there's somthing I'm missing. I can modify these settings using the dialog editor, but I don't seee how to change the options during run-time, at least not in VC++.
Thank you.
Jennifer Britt
Posted: Mon Nov 13, 2006 9:39 am
by Pep
Hi Jennifer,
using the latest v7.012 posted on our web site you should be able to do it using the following code :
Code: Select all
m_listbox.SetChartLink(m_chart.GetChartLink());
m_listbox.SetAskDelete(true);
m_listbox.SetAllowDeleteSeries(true);
m_listbox.SetAllowAddSeries(true);
m_listbox.SetItemHeight(30);
Posted: Wed Nov 15, 2006 1:52 am
by 9527696
Hello Josep,
Thank you for your reply.
The problem I experienced, though, was that my header files were not updated when I updated my TeeChart7.ocx file. I thought that the header files in my
Program Files\Steema Software directory would have been updated at the same time, but they were not.
I got around this problem by doing the following.
- Create a new temporary project
Add a TeeListBox component to the project. This generates new header files.
Copy over the newly genearted files over to my working project.
I am not sure if there is a cleaner way around this, but that seemed to work for me. Can you please tell me if there is a cleaner way to do this when we update our TChart project?
Thank you!
Jennifer Britt
Posted: Tue Nov 21, 2006 10:16 am
by Pep
Hi Jennifer,
yes, you're correct, we forgot to update the header files with the new maintenance release. The steps you've done are correct ones.
Just in case you have any problems with this, here you can see how to regenerate then :
http://www.teechart.net/support/viewtop ... c&start=15.