Hi,
I had put t chart control on a Dockable Form. with dockStyle Fill.
when I try to acess its width it returns. default width which i had set @ design time.
it doesn't returns the exact width of Control. after docking.
How evever it return exact Width in after draw and before draw event.
i am using this width for some calculations. can u please help me how can i get proper width.
Unable to get exact width of TchartControl.
Hi Pradip,
This code seems to work fine for me here. Could you please try if it works as expected for you? Or could you please add the necessary changes to reproduce it?
This code seems to work fine for me here. Could you please try if it works as expected for you? Or could you please add the necessary changes to reproduce it?
Code: Select all
private void InitializeChart()
{
chartController1.Chart = tChart1;
tChart1.Aspect.View3D = false;
before = tChart1.Width.ToString();
tChart1.Dock = DockStyle.Fill;
after = tChart1.Width.ToString();
tChart1.Header.Text = "before: " + before + " after: " + after;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Pradip,
I can't reproduce your problem. Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
I can't reproduce your problem. Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
hi Yeray
here is the code
private void InitializeComponent()
{
this.tChart1 = new Steema.TeeChart.TChart();
this.SuspendLayout();
//
// tChart1
//
//
//
//
this.tChart1.Aspect.ZOffset = 0;
this.tChart1.Location = new System.Drawing.Point(0, 0);
this.tChart1.Name = "tChart1";
//this.tChart1.Size = new System.Drawing.Size(672, 346);
string before = tChart1.Width.ToString();
this.tChart1.Dock = System.Windows.Forms.DockStyle.Fill;
string after = tChart1.Width.ToString();
tChart1.Header.Text = "before: " + before + " after: " + after;
this.tChart1.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(672, 346);
this.Controls.Add(this.tChart1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
please let me know what is going wrong
here is the code
private void InitializeComponent()
{
this.tChart1 = new Steema.TeeChart.TChart();
this.SuspendLayout();
//
// tChart1
//
//
//
//
this.tChart1.Aspect.ZOffset = 0;
this.tChart1.Location = new System.Drawing.Point(0, 0);
this.tChart1.Name = "tChart1";
//this.tChart1.Size = new System.Drawing.Size(672, 346);
string before = tChart1.Width.ToString();
this.tChart1.Dock = System.Windows.Forms.DockStyle.Fill;
string after = tChart1.Width.ToString();
tChart1.Header.Text = "before: " + before + " after: " + after;
this.tChart1.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(672, 346);
this.Controls.Add(this.tChart1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
please let me know what is going wrong
Hi Pradip,
Are you writing code directly to the Form1.Designer.cs?
To view the values before and after the changes, you should see them in runtime, so try the code to the Form1.cs.
Are you writing code directly to the Form1.Designer.cs?
To view the values before and after the changes, you should see them in runtime, so try the code to the Form1.cs.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
string before = tChart1.Width.ToString();
tChart1.Dock = DockStyle.Fill;
string after = tChart1.Width.ToString();
tChart1.Header.Text = "before: " + before + " after: " + after;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |