private void treeView1_MouseUp(object sender, MouseButtonEventArgs e) { var item = TreeView1.SelectedItem as TreeViewItem; if (item == null) { return; } if (_parser.LocalFunctions.ContainsKey(item.Header.ToString())) { TextBox1.SelectedText = item.Header + "("; TextBox1.Focus(); TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0); } else if (_parser.LocalVariables.ContainsKey(item.Header.ToString())) { TextBox1.SelectedText = item.Header + " := "; TextBox1.Focus(); TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0); } else if (_parser.OperatorList.Contains(item.Header.ToString())) { TextBox1.SelectedText = item.Header.ToString(); TextBox1.Focus(); TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0); } }
private void TextBox1_GotFocus(object sender, System.EventArgs e) { if (IgnoreEvents == 0) { IgnoreEvents++; if (m_TemporaryReadOnly == false && m_ReadOnly == false) { if (this.Grayed) { IgnoreChanges++; this.TextBox1.Text = ""; IgnoreChanges--; this.Grayed = false; this.ApplyStyle(); } } TextBox1.Select(); IgnoreEvents--; if (null != GotFocus) { GotFocus(this, e); } } }
private void TextBox1_GotFocus(object sender, System.EventArgs e) { if (IgnoreEvents == 0 && this.TemporaryReadOnly == false && this.ReadOnly == false) { if (m_TemporaryReadOnly == false && this.ReadOnly == false) { if (m_TemporaryReadOnly == false && this.ReadOnly == false) { switch (this.DataType) { case DataTypes.Currency: case DataTypes.Date: case DataTypes.Float: case DataTypes.Integer: case DataTypes.Stock: TextBox1.SelectAll(); break; default: TextBox1.Select(TextBox1.Text.Length, 0); break; } } else { TextBox1.Select(TextBox1.Text.Length, 0); } } else { TextBox1.Select(TextBox1.Text.Length, 0); } } }
public void EventMoveIndexLocation(int number) { //TextBox1.SelectionStart=TextBox1.GetLineFromCharIndex(number); int caratIndex = TextBox1.GetFirstCharIndexFromLine(number); TextBox1.Select(caratIndex, 0); TextBox1.ScrollToCaret(); }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { var Var4 = TextBox1.Text; var Var5 = comboBox1.SelectedItem; var Var6 = comboBox2.SelectedItem; var Var7 = dateTimePicker1.Value.ToString(); var Var9 = textBox2.Text; if (Var4 == "" || comboBox1.Text == "" || comboBox2.Text == "" || textBox2.Text == "") { MessageBox.Show("all fields required"); } else { Random Var8 = new Random(); int aa = Var8.Next(1, 1000); SqlDataAdapter adapter = new SqlDataAdapter(); string sql = null; SqlConnection cnn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\mohamed chagour\Documents\Leoni.mdf;Integrated Security=True;Connect Timeout=30"); //Tester sur code SqlDataAdapter sda = new SqlDataAdapter("Select count(*) from pc where code='" + aa + "'", cnn); DataTable dt = new DataTable(); sda.Fill(dt); while (dt.Rows[0][0].Equals(1)) { aa = Var8.Next(1, 1000); } sql = "insert into pc (nom, ps,action,date,code,num) values('" + Var4 + "','" + Var5 + "','" + Var6 + "','" + Var7 + "','" + aa + "','" + Var9 + "')"; SqlDataAdapter sda1 = new SqlDataAdapter("select count(nom) from pc where nom = '" + Var4 + "'", cnn); DataTable dt1 = new DataTable(); sda1.Fill(dt1); if (dt1.Rows[0][0].ToString() == "1") { MessageBox.Show("Pc name already exist"); } else { cnn.Open(); adapter.InsertCommand = new SqlCommand(sql, cnn); adapter.InsertCommand.ExecuteNonQuery(); MessageBox.Show("You PC Code is " + aa); string[] lines = { "^Q30,3", "^W50", "^H5", "^P1", "^S2", "^AD", "^C1", "^R0", "~Q+0", "^O0", "^D0", "^E12", "~R200", "^XSET,ROTATION,0", "^L", "Dy2-me-dd", "Th:m:s", "AD,10,54,1,1,0,0E,Nom PC:", "AD,10,120,1,1,0,0E,Code:", "AD,150,54,1,1,0,0E," + Var4 + "", "AD,108,122,1,1,0,0E," + aa + "", "E", "" }; System.IO.File.WriteAllLines(@"C:\Users\mohamed chagour\source\repos\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\etiquette.txt", lines); Process.Start(@"C:\Users\mohamed chagour\source\repos\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\etiquette.bat"); } textBox2.Clear(); TextBox1.Clear(); comboBox1.Refresh(); TextBox1.Select(); } }
public void OutPut(string text, Color color, Font font) { TextBox1HP.OutPutSuper(TextBox1, text, color, font); TextBox1.Select(TextBox1.TextLength, 0); TextBox1.ScrollToCaret(); if (Properties.Settings.Default.IsTXTOut) { TXTOutput(text); } }
private void listView1_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (ListView1.SelectedItem == null) { return; } TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0); TextBox1.SelectedText = (String)ListView1.SelectedItem; }
private void TextBox1_TextChanged(object sender, TextChangedEventArgs e) { string mensaje = ""; if (TextBox1 != null) { mensaje = TextBox1.Text.ToUpper(); TextBox1.Select(mensaje.Length, 0); TextBox1.Text = mensaje; } }
private void dgvpopup_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { Sel_Value(); } else if (e.KeyData == Keys.Up && dgvpopup.CurrentRow.Index < 1) { TextBox1.Select(); } }
private void FindTextDefault() { if (IndexLocation == -1) { MessageBox.Show(string.Format("\"{0}\"을(를) 찾을 수 없습니다.", FindTextSave), "메모장"); } else { TextBox1.Select(IndexLocation, FindTextSave.Length); TextBox1.ScrollToCaret(); } }
private void dataGrid1_MouseDoubleClick(object sender, MouseButtonEventArgs e) { dynamic item = DataGrid1.SelectedItem; if (item.Key == "") { return; } TextBox1.SelectedText = item.Key; TextBox1.Focus(); TextBox1.Select(TextBox1.SelectionStart + TextBox1.SelectionLength, 0); }
private void TextBox1_KeyPress(object sender, KeyPressEventArgs e) { if (char.IsDigit(e.KeyChar) && (TextBox1.Text.Length >= Min | TextBox1.Text.Length <= Max)) { e.Handled = false; } else if (char.IsControl(e.KeyChar)) { e.Handled = false; } else { var aceptaNegativos = MinimoValor != null && MinimoValor < 0; var desdeElPrincipio = string.IsNullOrEmpty(TextBox1.Text) || TextBox1.SelectedText.Count() == TextBox1.Text.Count(); if (AceptaDecimales) { if (!desdeElPrincipio) { var contieneComa = TextBox1.Text.ToList().Any(ch => separadores.Contains(ch)); if ((e.KeyChar == char.Parse(",") || e.KeyChar == char.Parse(".")) && !contieneComa) { e.Handled = false; } else { e.Handled = true; } } else if (e.KeyChar == char.Parse(".")) { e.Handled = true; TextBox1.Text = "0."; TextBox1.Select(TextBox1.Text.Length, 0); } else { e.Handled = true; } } else { if (desdeElPrincipio) { e.Handled = !(aceptaNegativos && e.KeyChar == char.Parse("-")); } } } }
private void ComboBox_Enter(object sender, EventArgs e) { if (this.AutoSize || this.AlwaysExpanded) { ItemList.Visible = true; } if (ItemList.Visible && this.ActiveControl != ItemList) { ItemList.Select(); } else if (TextBox1.Visible && this.ActiveControl != TextBox1) { TextBox1.Select(); } }
private void frmPopup_Load(object sender, EventArgs e) { for (int i = 0; i < strdisp_name.Length; i++) { fields = strdisp_name[i].Split(';'); // if (fields[0].Trim().ToLower() != strdisp_value[0].Trim().ToLower() && fields[0].Trim().ToLower() != strdisp_value[1].Trim().ToLower()) if (fields[0].Trim().ToLower() != strStore_Id.Trim().ToLower() && fields[0].Trim().ToLower() != strStoring_nm.Trim().ToLower()) { getfields += fields[0] + ","; if (fields.Length > 1) { setfields += fields[1] + ","; } } } if (_tran_cd == "") { if (_con != "") { strQueryUpdate = "select " + getfields + strStore_Id.Trim().ToLower() + "," + strStoring_nm.Trim().ToLower() + " from " + table + " where " + _con; } else { strQueryUpdate = "select " + getfields + strStore_Id.Trim().ToLower() + "," + strStoring_nm.Trim().ToLower() + " from " + table; } } else { if (_con != "") { strQueryUpdate = "select " + getfields + strStore_Id.Trim().ToLower() + "," + strStoring_nm.Trim().ToLower() + " from " + table + " where tran_cd='" + _tran_cd + "' and " + _con; } else { strQueryUpdate = "select " + getfields + strStore_Id.Trim().ToLower() + "," + strStoring_nm.Trim().ToLower() + " from " + table + " where tran_cd='" + _tran_cd + "'"; } } ds = objdblayer.dsquery(strQueryUpdate); BIND_GRID(); // TextBox1.Text = htpopup[strStoring_nm] != null ? htpopup[strStoring_nm].ToString() : ""; TextBox1.Select(); //if (TextBox1.CanFocus) //{ // TextBox1.Focus(); //} }
public void LoadData(String str, String frmCaption) { gStr = str; dtName = "PackCategory"; this.Text = frmCaption; dtBroker = new DataTable(dtName); Database.GetSqlData("select * from " + dtName + " where PackCat_id='" + str + "'", dtBroker); TextBox1.Select(); if (dtBroker.Rows.Count == 0) { dtBroker.Rows.Add(0); TextBox1.Text = ""; } else { TextBox1.Text = dtBroker.Rows[0]["name"].ToString(); } }
private void timer1_Tick(object sender, EventArgs e) { //每? 0.1小时进行一次存档备份 SaveGame(); //清空文本//防止输出文本超过上限导致溢出 if (TextBox1.TextLength >= 214748364) { TextBox1.Text = TextBox1.Text.Substring(214746364); TextBox1HP.SetRTF(TextBox1); TextBox1.Select(TextBox1.TextLength, 0); TextBox1.ScrollToCaret(); } //判断有没有过一天 if (timeRels != DateTime.Now.Day) { RelsUser(); } }
public void LoadData(String str, String frmCaption) { gStr = str; dtName = "city"; dtCity = new DataTable(dtName); Database.GetSqlData("select * from " + dtName + " where City_id='" + str + "'", dtCity); this.Text = frmCaption; if (dtCity.Rows.Count == 0) { dtCity.Rows.Add(0); TextBox1.Select(); TextBox1.Text = ""; } else { TextBox1.Select(); TextBox1.Text = dtCity.Rows[0]["Cname"].ToString(); } }
private void SearchText() { TextBox1.Select(TextBox1.SelectionStart, 0); if (SearchForm.OverOrUnderButton) { TextBox1.SelectionStart -= TextCount; TextCount = FindTextSave.Length; int selectCount = TextBox1.SelectionStart; FindTextUp(); } else { TextBox1.SelectionStart += TextCount; TextCount = FindTextSave.Length; int selectCount = TextBox1.SelectionStart; FindTextDown(); FindTextDefault(); } FindTextDefault(); }
new public void Focus() { TextBox1.Focus(); TextBox1.Select(); }
private void OnTextBoxClearSelectionClicked(object sender, object args) { TextBox1.Select(0, 0); }
private void Form1_Shown(object sender, EventArgs e) { string FileName = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "File1.xlsx"); OleDbHelper.Connections Connection = new OleDbHelper.Connections(); using (OleDbConnection cn = new OleDbConnection { ConnectionString = Connection.HeaderConnectionString(FileName, 0) }) { using (OleDbCommand cmd = new OleDbCommand { Connection = cn }) { cn.Open(); cmd.CommandText = @" CREATE TABLE Members ( FirstName CHAR(255), LastName CHAR(255), JoinedYear INT )"; cmd.ExecuteNonQuery(); cmd.Parameters.AddRange(new OleDbParameter[] { new OleDbParameter { ParameterName = "@FirstName", DbType = DbType.String }, new OleDbParameter { ParameterName = "@LastName", DbType = DbType.String }, new OleDbParameter { ParameterName = "@JoinedYear", DbType = DbType.String } }); int Result = 0; Customers CustomersToAdd = new Customers(); foreach (Customer cust in CustomersToAdd.List) { Console.WriteLine(cust.ToString()); } System.Text.StringBuilder sb = new System.Text.StringBuilder(); cmd.CommandText = @" INSERT INTO Members ( FirstName, LastName, JoinedYear ) VALUES ( @FirstName, @LastName, @JoinedYear ) "; foreach (var cust in CustomersToAdd.List) { cmd.Parameters["@FirstName"].Value = cust.FirstName; cmd.Parameters["@LastName"].Value = cust.LastName; cmd.Parameters["@JoinedYear"].Value = cust.JoinedYear; Result = cmd.ExecuteNonQuery(); if (Result != 1) { sb.AppendLine("Insert failed"); } else { sb.AppendLine("Success"); } } TextBox1.Text = sb.ToString(); TextBox1.Select(0, 0); } } }
private void frmLocate_Load(object sender, EventArgs e) { fin_yr = ObjBFD.ObjCompany.Fin_yr; string str_nm = (alias_nm == strStoring_nm ? strStoring_nm.Trim().ToLower() : alias_nm + " as " + strStoring_nm.Trim().ToLower()); string str_id = (alias_id == strStore_Id ? strStore_Id.Trim().ToLower() : alias_id + " as " + strStore_Id.Trim().ToLower()); DataSet dsDDL1 = new DataSet(); DataSet dsDDL2 = new DataSet(); dsDDL1 = objdlAdapter.dsquery("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = '" + table + "' AND COLUMN_NAME = 'compid'"); dsDDL2 = objdlAdapter.dsquery("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = '" + table + "' AND COLUMN_NAME = 'fin_yr'"); if (dsDDL1 != null && dsDDL1.Tables.Count != 0 && dsDDL1.Tables[0].Rows.Count != 0) { blnCompid = true; } if (strstatus != "0" && dsDDL2 != null && dsDDL2.Tables.Count != 0 && dsDDL2.Tables[0].Rows.Count != 0) { blnFin_Yr = true; } objFL_BASEFIELD.objCompany = ObjBFD.ObjCompany;//objCompany; for (int i = 0; i < strdisp_name.Length; i++) { fields = strdisp_name[i].Split(';'); if (fields[0].Trim().ToLower() != alias_id.Trim().ToLower() && fields[0].Trim().ToLower() != alias_nm.Trim().ToLower()) { getfields += fields[0] + ","; if (fields.Length > 1) { setfields += fields[1] + ","; } } } #region 1.0 if (str_nm == "tran_cd") { str_nm = "tran_cd"; } if (str_id == "tran_id") { str_id = "tran_id"; } if (blnFin_Yr) { strQueryExistance = "select " + str_nm + "," + getfields + str_id + ",fin_yr from " + table + " where 1=1 "; } else { strQueryExistance = "select " + str_nm + "," + getfields + str_id + " from " + table + " where 1=1 "; } if (_tran_cd == "") { if (_con != "") { if (blnCompid) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "'"; } //if (blnFin_Yr) //{ // strQueryExistance += " and fin_yr='" + ObjBFD.ObjCompany.Fin_yr + "'"; //} strQueryExistance += " and " + _con; } else { if (blnCompid) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "'"; } //if (blnFin_Yr) //{ // strQueryExistance += " and fin_yr='" + ObjBFD.ObjCompany.Fin_yr + "'"; //} } } else { if (_con != "") { if (blnCompid) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "'"; } //if (blnFin_Yr) //{ // strQueryExistance += " and fin_yr='" + ObjBFD.ObjCompany.Fin_yr + "'"; //} strQueryExistance += " and tran_cd='" + _tran_cd + "' and " + _con; } else { if (blnCompid) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "'"; } //if (blnFin_Yr) //{ // strQueryExistance += " and fin_yr='" + ObjBFD.ObjCompany.Fin_yr + "'"; //} strQueryExistance += " and tran_cd='" + _tran_cd + "'"; } } string strTran_dt = ObjBFD.HTMAIN.Contains("tran_dt") && ObjBFD.HTMAIN["tran_dt"] != null && ObjBFD.HTMAIN["tran_dt"].ToString() != "" ? ObjBFD.HTMAIN["tran_dt"].ToString() : "getdate()"; DataSet dsIsDeactivate = objdlAdapter.dsquery("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = '" + table + "' AND COLUMN_NAME = 'isdeactive'"); if (strstatus == "0" && (dsIsDeactivate != null && dsIsDeactivate.Tables.Count != 0 && dsIsDeactivate.Tables[0].Rows.Count != 0)) { DataSet dsetDeactivatefrm = objdlAdapter.dsquery("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = '" + table + "' AND COLUMN_NAME = 'deactfrm'"); if (dsetDeactivatefrm != null && dsetDeactivatefrm.Tables.Count != 0 && dsetDeactivatefrm.Tables[0].Rows.Count != 0) { strQueryUpdate = strQueryExistance + " and isdeactive=case when(isdeactive=1) then case when(datediff(day,'" + strTran_dt + "',case when(deactfrm='1900-01-01 00:00:00.000' or deactfrm='2000-01-01 00:00:00.000') then '" + strTran_dt + "' else deactfrm end)>=0) then 1 else 0 end else 0 end"; } else { strQueryUpdate = strQueryExistance + " and isdeactive=0"; } } else { strQueryUpdate = strQueryExistance; } #endregion 1.0 ds = objFL_BASEFIELD.GETPOPUPDETAILS(strQueryUpdate); TextBox1.Text = htpopup[strStoring_nm] != null ? htpopup[strStoring_nm].ToString() : ""; TextBox1.Select(); if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0) { BIND_GRID(); } objIni.SetKeyFieldValue("SQL", "initial catalog", "InodeMFG"); //setting database DataSet dsetFY = objdlAdapter.dsquery("SELECT * FROM COMP_FIN_YR_MAPPING where compid='" + ObjBFD.ObjCompany.Compid + "'"); objIni.SetKeyFieldValue("SQL", "initial catalog", ObjBFD.ObjCompany.Db_nm); //setting database if (dsetFY != null && dsetFY.Tables.Count != 0 && dsetFY.Tables[0].Rows.Count != 0) { comboBox1.DataSource = dsetFY.Tables[0]; comboBox1.DisplayMember = "fin_yr"; comboBox1.ValueMember = "fin_yr_id"; comboBox1.Update(); } comboBox1.Text = ObjBFD.ObjCompany.Fin_yr; if (comboBox1.SelectedValue != null && comboBox1.SelectedValue.ToString() != "") { selected_value = Convert.ToInt32(comboBox1.SelectedValue.ToString()); } this.BackColor = ObjBFD.ObjControlSet.Back_color != null?Color.FromName(ObjBFD.ObjControlSet.Back_color) : Color.White; this.ForeColor = ObjBFD.ObjControlSet.Font_color != null?Color.FromName(ObjBFD.ObjControlSet.Font_color) : Color.Black; ucToolBar1.Width = this.Width; this.ucToolBar1.Maximize = false; ucToolBar1.Width1 = this.Width; ucToolBar1.UCbackcolor = ObjBFD.ObjControlSet.Uc_color != null?Color.FromName(ObjBFD.ObjControlSet.Uc_color) : Color.Maroon; this.Font = new Font(ObjBFD.ObjControlSet.Font_family != null ? ObjBFD.ObjControlSet.Font_family : "Courier New", float.Parse(ObjBFD.ObjControlSet.Font_size != null ? ObjBFD.ObjControlSet.Font_size : "9")); this.CenterToScreen(); }
private void frmPopup_Load(object sender, EventArgs e) { string str_nm = (alias_nm == strStoring_nm ? strStoring_nm.Trim().ToLower() : alias_nm + " as " + strStoring_nm.Trim().ToLower()); string str_id = (alias_id == strStore_Id ? strStore_Id.Trim().ToLower() : alias_id + " as " + strStore_Id.Trim().ToLower()); DataSet dsDDL1 = new DataSet(); dsDDL1 = objdlAdapter.dsquery("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = '" + table + "' AND COLUMN_NAME = 'compid'"); objFL_BASEFIELD.objCompany = ObjBFD.ObjCompany;//objCompany; for (int i = 0; i < strdisp_name.Length; i++) { fields = strdisp_name[i].Split(';'); if (fields[0].Trim().ToLower() != alias_id.Trim().ToLower() && fields[0].Trim().ToLower() != alias_nm.Trim().ToLower()) { getfields += fields[0] + ","; if (fields.Length > 1) { setfields += fields[1] + ","; } } } #region 1.0 strQueryExistance = "select " + str_nm + "," + getfields + str_id + " from " + table + " where 1=1 "; if (_tran_cd == "") { if (_con != "") { if (dsDDL1 != null && dsDDL1.Tables.Count != 0 && dsDDL1.Tables[0].Rows.Count != 0) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "' and " + _con; } else { strQueryExistance += " and " + _con; } } else if (_Qcd) { strCon = GetDynamicCondition(); if (dsDDL1 != null && dsDDL1.Tables.Count != 0 && dsDDL1.Tables[0].Rows.Count != 0) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "' and " + strCon; } else { strQueryExistance += " and " + strCon; } } else { if (dsDDL1 != null && dsDDL1.Tables.Count != 0 && dsDDL1.Tables[0].Rows.Count != 0) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "'"; } } } else { if (_con != "") { if (dsDDL1 != null && dsDDL1.Tables.Count != 0 && dsDDL1.Tables[0].Rows.Count != 0) { strQueryExistance += " and tran_cd='" + _tran_cd + "' and compid='" + ObjBFD.ObjCompany.Compid + "' and " + _con; } else { strQueryExistance += " and tran_cd='" + _tran_cd + "' and " + _con; } } else if (_Qcd) { strCon = GetDynamicCondition(); if (dsDDL1 != null && dsDDL1.Tables.Count != 0 && dsDDL1.Tables[0].Rows.Count != 0) { strQueryExistance += " and compid='" + ObjBFD.ObjCompany.Compid + "' and " + strCon; } else { strQueryExistance += " and " + strCon; } } else { if (dsDDL1 != null && dsDDL1.Tables.Count != 0 && dsDDL1.Tables[0].Rows.Count != 0) { strQueryExistance += " and tran_cd='" + _tran_cd + "' and compid='" + ObjBFD.ObjCompany.Compid + "'"; } else { strQueryExistance += " and tran_cd='" + _tran_cd + "'"; } } } string strTran_dt = ObjBFD.HTMAIN.Contains("tran_dt") && ObjBFD.HTMAIN["tran_dt"] != null && ObjBFD.HTMAIN["tran_dt"].ToString() != "" ? ObjBFD.HTMAIN["tran_dt"].ToString() : DateTime.Now.ToString(); DataSet dsIsDeactivate = objdlAdapter.dsquery("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = '" + table + "' AND COLUMN_NAME = 'isdeactive'"); if (strstatus == "0" && (dsIsDeactivate != null && dsIsDeactivate.Tables.Count != 0 && dsIsDeactivate.Tables[0].Rows.Count != 0)) { DataSet dsetDeactivatefrm = objdlAdapter.dsquery("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = '" + table + "' AND COLUMN_NAME = 'deactfrm'"); if (dsetDeactivatefrm != null && dsetDeactivatefrm.Tables.Count != 0 && dsetDeactivatefrm.Tables[0].Rows.Count != 0) { strQueryUpdate = strQueryExistance + " and isdeactive=case when(isdeactive=1) then case when(datediff(day,'" + strTran_dt + "',case when(deactfrm='1900-01-01 00:00:00.000' or deactfrm='2000-01-01 00:00:00.000') then '" + strTran_dt + "' else deactfrm end)>=0) then 1 else 0 end else 0 end"; } else { strQueryUpdate = strQueryExistance + " and isdeactive=0"; } } else { strQueryUpdate = strQueryExistance; } #endregion 1.0 ds = objFL_BASEFIELD.GETPOPUPDETAILS(strQueryUpdate); TextBox1.Text = htpopup[strStoring_nm] != null ? htpopup[strStoring_nm].ToString() : ""; TextBox1.Select(); BIND_GRID(); this.BackColor = ObjBFD.ObjControlSet.Back_color != null?Color.FromName(ObjBFD.ObjControlSet.Back_color) : Color.White; this.ForeColor = ObjBFD.ObjControlSet.Font_color != null?Color.FromName(ObjBFD.ObjControlSet.Font_color) : Color.Black; ucToolBar1.Width = this.Width; this.ucToolBar1.Maximize = false; ucToolBar1.Width1 = this.Width; ucToolBar1.UCbackcolor = ObjBFD.ObjControlSet.Uc_color != null?Color.FromName(ObjBFD.ObjControlSet.Uc_color) : Color.Maroon; this.Font = new Font(ObjBFD.ObjControlSet.Font_family != null ? ObjBFD.ObjControlSet.Font_family : "Courier New", float.Parse(ObjBFD.ObjControlSet.Font_size != null ? ObjBFD.ObjControlSet.Font_size : "9")); this.CenterToScreen(); //if (TextBox1.CanFocus) //{ // TextBox1.Focus(); //} }
private void Button_Click(object sender, RoutedEventArgs e) { TextBox1.Select(5, 10); TextBox1.Focus(); }
private void Eula_Load(object sender, EventArgs e) { TextBox1.Select(0, 0); }
private void YTImport_Load(object sender, EventArgs e) { TextBox1.Select(); }
public UserControl1() { InitializeComponent(); TextBox1.Select(); TextBox1.Focus(); }
private void UserControl1_Load(object sender, EventArgs e) { TextBox1.Select(); TextBox1.Focus(); }