Re: [問題] 視窗位置

看板C_Sharp (C#)作者 (huggie)時間18年前 (2007/04/12 12:04), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串3/3 (看更多)
※ 引述《Eric30 (eric)》之銘言: : ※ 引述《huggie (huggie)》之銘言: : : 我想要讓 form 位置開在螢幕右下角 : : 請問這是要得到螢幕位置嗎? 還是要怎麼做? : : 那要怎麼設定呢? : Rectangle rect = Screen.GetWorkingArea(this); : this.Top = rect.Bottom - this.Height; : this.Left = rect.Right - this.Width; : this.StartPosition = FormStartPosition.Manual; 謝謝 我照著這樣做可是位置沒有到耶 又約多補了 Top + 173 跟 Width + 61 才到角落 我把這幾行放在 form 的 constructor 裡面, InitializeComponent() 之前, 請問這樣對嗎? 是不是原本在 IDE form properties 中設的 Size 屬性在 constructor 中還沒有生效? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.129.160.67

04/12 12:05, , 1F
啊! 放在 InitializeComponent 之後就 OK 了 多謝!
04/12 12:05, 1F
文章代碼(AID): #167Q_PQv (C_Sharp)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
文章代碼(AID): #167Q_PQv (C_Sharp)