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

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
fano
Newbie
Newbie
Posts: 56
Joined: Wed Jun 22, 2005 4:00 am
Location: USA, California

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

Post by fano » Thu Nov 10, 2005 10:35 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 11, 2005 2:57 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply