表格我有一個OK button
:如何對稱地放置按鈕?
在代碼中我添加cancel
按鈕,我想對稱設置。
Ok
按鈕有一個top,left
錨點。 cancel
按鈕 - top, right
按鈕。
而且我做的:
this.CancelButton.Location = new Point(this.OKButton.Location.X ,this.OKButton.Location.Y);
但cancel
按鈕設置比OK按鈕更接近中心。
後,我做的事:
var leftDash = this.Size.Width - this.OKButton.Location.X - this.CancelButton.Size.Width;
this.CancelButton.Location = new Point(leftDash, this.OKButton.Location.Y);
但都沒有看到形式cancel
按鈕。
任何建議?
一看微軟設計指南可以幫助:HTTP:// msdn.microsoft.com/en-us/library/windows/desktop/aa511268.aspx –