我必須固定在UI文本框是永遠不會分配給,永遠有它的默認值空
一些事情在應用程序運行完全正常 但是,當我改變的大小groupboxsize,它給我一個錯誤。
- 變量'txtHeureMinutes'要麼是未聲明的,要麼從未分配過 。
- 變量「txtHeureHeure」要麼是未申報或者被 從未分配
下面是一個代碼
public class NumericalTextBox : TextBox
{
private int MaxValue;
public NumericalTextBox(int max_value = -1)
{
MaxValue = max_value;
}
protected override void OnKeyDown(KeyEventArgs e)
{
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
}
}
partial class TestClass
{
// some code
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtHeureMinutes = new MyComp.Common.Controls.NumericalTextBox(60);
this.txtHeureHeure = new MyComp.Common.Controls.NumericalTextBox(24);
this.splitContainer1.Panel2.Controls.Add(this.groupBox1);
this.groupBox1.Controls.Add(this.txtHeureMinutes);
this.groupBox1.Controls.Add(this.txtHeureHeure);
this.groupBox1.Size = new System.Drawing.Size(270, 270);
}
// declaration
private MyComp.Common.Controls.NumericalTextBox txtHeureMinutes;
private MyComp.Common.Controls.NumericalTextBox txtHeureHeure;
}
問題是? – Max
我想這不是一個錯誤。這只是一個'警告'。 –
@MaxMommersteeg:我想現在你可以回答我的問題 – GameBuilder