Page 1 of 1

Zoom rectangle invisible if form opacity set to 0 and then 1

Posted: Thu Nov 10, 2005 10:35 pm
by 9637279
TeeChart .NET version 2.0.2040.15119

Hi, when you set the Opacity of your form to 0 and then to 1
then the rectangle outlining the zoom area stays invisible.
(Reason for doing this:
One may start with Opacity 0 and then gradually increase it
to blend-in the form through a timer, reaching Opacity 1).

See example below. Is there a work aournd?

public X_MainWindow()
{
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.Opacity = 0.0;
this.Opacity = 1.0;

etc.

Thanks,
fano

Posted: Fri Nov 11, 2005 2:57 pm
by narcis
Hi fano,

I've been able to reproduce what you reported and found that this can be solved assigning zoom pen's color after setting opacity=1, i.e.:

Code: Select all

		private void timer1_Tick(object sender, System.EventArgs e)
		{
			while (this.Opacity<1.0) this.Opacity+=0.01;

			timer1.Enabled=false;
			tChart1.Zoom.Pen.Color=Color.Black;
		}
The story is that this line: tChart1.Zoom.Pen.Color=Color.Black; Doesn't need to be set more than once. If this property is not set then the zoom rectangle will be drawn with System.Windows.Forms.ControlPaint. Which behaves as you can see when Form.Opacity is set. However, I have done some research in internet and Microsoft's documentation and haven't found any piece of information about that. So there's not much we can do for now.

BTW: I also noticed that setting zoom pen's color before applying initial opacity to your form works as well. This option may be more convenient for your needs.