//载入主窗口时,自动连接数据库 private void main_Load(object sender, EventArgs e) { comboBox_userType.SelectedIndex = 0; try { CADOConn.openConn(); } catch (Exception ex) { MessageBox.Show("数据库连接失败,原因如下:" + ex.Message, "提示"); Application.Exit(); } //设置提示 Win32Utility.SetCueText(textBox_user, Globalconst.PLEASE_INPUT_USERNAME); Win32Utility.SetCueText(textBox_password, Globalconst.PLEASE_INPUT_PASSWORD); //换肤 skinEngine1.SkinFile = Application.StartupPath + @"/Skins/page.ssk"; }
//窗口载入时,在TextBox中增加提示 private void queryForm_Load(object sender, EventArgs e) { //设置提示 Win32Utility.SetCueText(textBox_name, Globalconst.PLEASE_INPUT_NAME); Win32Utility.SetCueText(textBox_code, Globalconst.PLEASE_INPUT_CODE); }