Page 1 of 1

Annotation exceptions

Posted: Mon Jun 05, 2006 8:54 pm
by 9637279
Hi
When using annotations I find usaully always problems:
For example:
Use the Tools collection editor to add an annotation tool and
edit its name and then click 'ok'. -> it crashes with a System.NullReferenceException.
For example:
Add an annotation via the 'Edit' from the right click menu. Then
upon Initializing your form you set:

annotation.Active = false
In a button or some other UI element at a handler that sets:
annotation.Active = false
annotation.Shape.Transparency = 80;

Lauch application then click the button -> crash with null reference exception

For the latter one is there a work-around?
I'd like the annotation to be invisible at first and then
make it visible and set the transparency as shown above.
Thanks.
fano

Posted: Tue Jun 06, 2006 11:17 am
by narcis
Hi fano,
Use the Tools collection editor to add an annotation tool and
edit its name and then click 'ok'. -> it crashes with a System.NullReferenceException.


I can not reproduce it here, annotation name can not be edited. Are there any specific steps we could follow to reproduce the problem here?
For example:
Add an annotation via the 'Edit' from the right click menu. Then
upon Initializing your form you set:

annotation.Active = false
In a button or some other UI element at a handler that sets:
annotation.Active = false
annotation.Shape.Transparency = 80;

Lauch application then click the button -> crash with null reference exception

For the latter one is there a work-around?
I'd like the annotation to be invisible at first and then
make it visible and set the transparency as shown above.
Yes, you can use:

Code: Select all

annotation1.Shape.Brush.Transparency = 80;

reporducing the exception upon changing the name of the anno

Posted: Tue Jun 06, 2006 2:56 pm
by 9637279
Hi,

to reproduce the exception for annotation name property change:

1. In design mode click on the tchart and then loock at its
properties in the .NET solution explorer (click the properties tab)
2. Click on the 'Tool' property which will bring up the collection editor for all
the tools in the chart
3. Add an annotation and look at the 'Name' property shown in
that collection editor.
4. Change the name property (it is editable as is should be) and click the 'OK'
button
5 Exception happens and your form/dialog will reflect that clearly.

Thanks for the hint with the annotation.Shape.Brush.Transparency workaround. It works.
fano

Posted: Tue Jun 06, 2006 4:33 pm
by narcis
Hi fano,
to reproduce the exception for annotation name property change:

1. In design mode click on the tchart and then loock at its
properties in the .NET solution explorer (click the properties tab)
2. Click on the 'Tool' property which will bring up the collection editor for all
the tools in the chart
3. Add an annotation and look at the 'Name' property shown in
that collection editor.
4. Change the name property (it is editable as is should be) and click the 'OK'
button
5 Exception happens and your form/dialog will reflect that clearly.
Thanks for the information. I could reproduce the problem and I've added it to our wish-list to be enhanced for future releases.
Thanks for the hint with the annotation.Shape.Brush.Transparency workaround. It works.
This has already been fixed so you'll be able to use what you originally intended in the next release.