728x90
C# 에서 자식창을 띄울때 창의 마지막 크기와 위치를 저장하고 싶을 때
먼저, 솔루션 탐색기에서 Properties 를 선택하고 Settings.settings 를 더블 클릭한다.
아래 그림처럼 이름과 형식을 설정해준다.
이제 이벤트를 생성하여 코드를 추가한다.
private void WBrowser_FormClosing(object sender, FormClosingEventArgs e)
{
Properties.Settings.Default.FormSize = this.Size;
Properties.Settings.Default.Location = this.Location;
Properties.Settings.Default.Save();
}
private void WBrowser_Load(object sender, EventArgs e)
{
this.Size = Properties.Settings.Default.FormSize;
this.Location = Properties.Settings.Default.Location;
}
창의 최소 사이즈는 속성에서 설정해준다.
728x90
'C# > Layout 및 델리게이트' 카테고리의 다른 글
C# 델리게이트(delegate) 개념 잡히는 예제 (5) | 2016.01.17 |
---|---|
C# 자식 Form 의 위치를 내마음대로 (2) | 2015.12.16 |
C# 로그인 ID 정보 저장 (Properties.Settings 이용) (3) | 2015.12.03 |
C# 폼간 데이터 전송 : Properties(속성) get, set (완벽한 정리) (6) | 2015.11.30 |
C# 폼간 데이터 전송 (부모폼에서 자식폼, 자식폼에서 부모폼) (0) | 2015.11.29 |