SMALL
폼닫기 이벤트 지정
/// <summary>
/// 폼 닫기 이벤트 핸들러 선언
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void Form_Closing(object sender, FormClosedEventArgs e)
{
propertyCloseMethod();
}
닫기이벤트지정
private void propertyCloseMethod()
{
Properties.Settings.Default.host = textBoxHost.Text;
Properties.Settings.Default.port = textBoxPort.Text;
Properties.Settings.Default.qos = comboBoxQos.Text;
Properties.Settings.Default.topicSub = textBoxSubTopic.Text;
Properties.Settings.Default.topicPub1 = textBoxPubTopic.Text;
Properties.Settings.Default.topicPm1 = textBoxMessage.Text;
Properties.Settings.Default.topicPub2 = textBoxPT2.Text;
Properties.Settings.Default.topicPm2 = textBoxM2.Text;
Properties.Settings.Default.topicPub3 = textBoxPT3.Text;
Properties.Settings.Default.topicPm3 = textBoxM3.Text;
Properties.Settings.Default.topicPub4 = textBoxPT4.Text;
Properties.Settings.Default.topicPm4 = textBoxM4.Text;
Properties.Settings.Default.red = textBoxRed.Text;
Properties.Settings.Default.green = textBoxGreen.Text;
Properties.Settings.Default.yellow = textBoxYellow.Text;
Properties.Settings.Default.gray = textBoxGray.Text;
Properties.Settings.Default.navy = textBoxNavy.Text;
Properties.Settings.Default.purple = textBoxPurple.Text;
Properties.Settings.Default.lime = textBoxLime.Text;
Properties.Settings.Default.Save(); ;
}
폼로드시 저장된값 불러오기 지정
private void propertyCloseMethod()
{
Properties.Settings.Default.host = textBoxHost.Text;
Properties.Settings.Default.port = textBoxPort.Text;
Properties.Settings.Default.qos = comboBoxQos.Text;
Properties.Settings.Default.topicSub = textBoxSubTopic.Text;
Properties.Settings.Default.topicPub1 = textBoxPubTopic.Text;
Properties.Settings.Default.topicPm1 = textBoxMessage.Text;
Properties.Settings.Default.topicPub2 = textBoxPT2.Text;
Properties.Settings.Default.topicPm2 = textBoxM2.Text;
Properties.Settings.Default.topicPub3 = textBoxPT3.Text;
Properties.Settings.Default.topicPm3 = textBoxM3.Text;
Properties.Settings.Default.topicPub4 = textBoxPT4.Text;
Properties.Settings.Default.topicPm4 = textBoxM4.Text;
Properties.Settings.Default.red = textBoxRed.Text;
Properties.Settings.Default.green = textBoxGreen.Text;
Properties.Settings.Default.yellow = textBoxYellow.Text;
Properties.Settings.Default.gray = textBoxGray.Text;
Properties.Settings.Default.navy = textBoxNavy.Text;
Properties.Settings.Default.purple = textBoxPurple.Text;
Properties.Settings.Default.lime = textBoxLime.Text;
Properties.Settings.Default.Save(); ;
}
폼로드에
propertyload()추가
참고링크
LIST
'일반' 카테고리의 다른 글
C# ini 저장해서 재실행시 불러오기 (0) | 2022.03.07 |
---|---|
mosquitto conf (0) | 2022.03.07 |
C# 폴더열기 (0) | 2022.03.04 |
데이터그리드뷰 특정값 열 색상채우기 (0) | 2022.03.04 |
C# 데이터그리드뷰 focus 맞추기 (0) | 2022.03.04 |