Author |
Topic  |
|
zeng
2 Posts |
Posted - 07 Nov 2008 : 09:04:24
|
I program with VS 2005 C#. In my Form, I want to user the class ThermostatUserControl1 : com.quinncurtis.chart2dnet.ChartView in the Examples :C:\Quinn-Curtis\DotNet\QCRTGraph\Visual CSharp\examples\HomeAutomation But I can't changer the size of this class smaller than 200 X 200. I use this code : SetMinimumSize( new Size(100,100)); but it is always 200 X 200. Who can help me? It is urgent.
Zeng |
|
quinncurtis
1164 Posts |
Posted - 07 Nov 2008 : 11:18:56
|
We added the SetMinimumSize line to the ThermostatUserControl1 class:
public ThermostatUserControl1() { this.SetMinimumSize( new Size(100, 100));
// This call is required by the Windows.Forms Form Designer. InitializeComponent();
// TODO: Add any initialization after the InitForm call }
And we changed the size in the HomeAutomationUserControl1 property initialization code.
#region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.thermostatUserControl11.BackgroundDrawEnable = true; this.thermostatUserControl11.Location = new System.Drawing.Point(16, 16); this.thermostatUserControl11.Name = "thermostatUserControl11"; this.thermostatUserControl11.RenderingMode = 0; this.thermostatUserControl11.ResizeMode = 1; this.thermostatUserControl11.Size = new System.Drawing.Size(100, 100); this.thermostatUserControl11.TabIndex = 0; this.thermostatUserControl11.TemperatureSetpointValue = 70; this.thermostatUserControl11.ThermostatTitle = "Zone 1"; this.thermostatUserControl11.ZOrderSortEnable = true; . . . }
It worked. The control does not look OK, because it was designed for the 200x200 size, but it does resize to the 100,100 control size.
|
 |
|
quinncurtis
1164 Posts |
Posted - 07 Nov 2008 : 11:56:38
|
We also found that it helped to change the size setting in the ThermostatUserControl1 class, in the InitializeComponent method.
this.Name = "ThermostatUserControl1"; this.Size = new System.Drawing.Size(100, 100); this.ResumeLayout(false); |
 |
|
zeng
2 Posts |
Posted - 08 Nov 2008 : 13:49:39
|
I understand, thank you very much. |
 |
|
|
Topic  |
|
|
|