Re: [問題] 視窗位置
※ 引述《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
04/12 12:05, 1F
討論串 (同標題文章)
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章