C#窗體實現打開窗口在最頂層,只打開一個窗口

  private void ButtonMeetingSetting_Click(object sender, EventArgs e)
        {

           
            Form_MeetingInfoSettings.GetIsOpen().Show();
            //實現窗口顯示
            Form_MeetingInfoSettings.GetIsOpen().WindowState = FormWindowState.Normal;
            //實現窗口回到最頂層
            Form_MeetingInfoSettings.GetIsOpen().TopMost = true;
            Form_MeetingInfoSettings.GetIsOpen().TopMost = false;

        }


    private static Form_MeetingInfoSettings form_MeetingInfoSettings = new Form_MeetingInfoSettings();

        public static Form_MeetingInfoSettings GetIsOpen()
        {
            if (form_MeetingInfoSettings.IsDisposed)
            {
                form_MeetingInfoSettings = new Form_MeetingInfoSettings();
                return form_MeetingInfoSettings;
            }
            else
            {
                return form_MeetingInfoSettings;
            }

       
       
        }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章