private void MainForm_Load(object sender, EventArgs e) { if (!SessionHelper.SYS_START_UP) { //that work! var message = new MassageBoxModel(); message.TITLE = SessionHelper.SYS_TITLE; message.MESSAGE = SessionHelper.SYS_ERROR_CODE + " : " + SessionHelper.SYS_ERROR_MESSAGE; message.BUTTON_TYPE = ButtonType.OK; using (MassageBox box = new MassageBox(message)) { box.ShowDialog(this); } Application.Exit(); } else { _obj = this; UserControlHelper.SetUserControl(panelClientBody, userControl: new UCClientBody(), dockStyle: UserControlDockStyle.DockStyleFill); // panelClientBody.BackgroundImage = Character.Resources.CharacterRes.bg_01; } }
void Awake() { instance = this; }