我有一個C#形式的一對按鈕單擊事件處理程序的代碼:C# - 不能設置form.height
class frmLogin
{
private const int SHORT_HEIGHT = 120;
private const int LONG_HEIGHT = 220;
private EventHandler ExpandHandler;
private EventHandler ShrinkHandler;
public frmLogin()
{
InitializeComponent();
ExpandHandler = new EventHandler(btnExpand_Click);
ShrinkHandler = new EventHandler(btnShrink_Click);
btnExpand.Click += ExpandHandler;
}
private void btnExpand_Click(object sender, EventArgs e)
{
this.Height = LONG_HEIGHT;
btnExpand.Text = "<< Hide Server";
btnExpand.Click -= ExpandHandler;
btnExpand.Click += ShrinkHandler;
}
private void btnShrink_Click(object sender, EventArgs e)
{
this.Height = SHORT_HEIGHT;
btnExpand.Text = "Choose Server >>";
btnExpand.Click -= ShrinkHandler;
btnExpand.Click += ExpandHandler;
}
}
時不會發生問題的文字變化,而是一個特定的客戶端機器上,戴爾M4300筆記本電腦工作站,高度變化不起作用。有沒有人解決了類似的問題,如果是這樣的話修復了什麼?
它可以在其他機器上工作嗎? – recursive 2008-12-12 00:05:19
游泳。這是我見過這個問題的唯一案例。我能想出的唯一概念是它是一個顯卡問題。 – 2008-12-12 00:07:05