public void AplicarApenasNumerosVirgulaSemMoeda(GunaLineTextBox txt) { //txt.Enter += TirarMascaraEnter; //txt.Leave += RetornarMascara; txt.KeyPress += ApenasValorNumericoVirgulas; //txt.KeyUp += FormatarMoeda; }
private void TxtTc_Leave(object sender, EventArgs e) { GunaLineTextBox textBox = (GunaLineTextBox)sender; watermark.TexboxCikis(textBox.Tag.ToString(), textBox); BtnKonuOner.Text = "Konu Öner"; }
public void SifreGizle(GunaLineTextBox textBox, PictureBox pictureBox) { if (textBox.ForeColor != Color.DarkGray) { textBox.PasswordChar = '*'; pictureBox.Image = Properties.Resources.icons8_eye_50px_1; } }
public void TexboxCikis(string mesaj, GunaLineTextBox textBox) { if (textBox.Text == string.Empty) { textBox.Text = mesaj; textBox.ForeColor = Color.DarkGray; } }
public void TexboxGiris(object sender) { GunaLineTextBox textBox = (GunaLineTextBox)sender; if (textBox.ForeColor == Color.DarkGray) { textBox.Text = string.Empty; } textBox.ForeColor = Color.FromArgb(53, 41, 123); }
public bool TxtBosluk(GunaLineTextBox Kulad, GunaLineTextBox GizYanit) { if (Kulad.ForeColor == Color.DarkGray || GizYanit.ForeColor == Color.DarkGray) { izin = false; } else { izin = true; } return(izin); }
public bool SifreBenzerlik(GunaLineTextBox sifre, GunaLineTextBox sifreTekrar) { if (sifre.Text != sifreTekrar.Text) { izin = false; } else { izin = true; } return(izin); }
public void ApenasValorNumericoVirgulas(object sender, KeyPressEventArgs e) { GunaLineTextBox txt = (GunaLineTextBox)sender; if (!char.IsDigit(e.KeyChar) && e.KeyChar != Convert.ToChar(Keys.Back)) { if (e.KeyChar == ',') { e.Handled = (txt.Text.Contains(',')); } else { e.Handled = true; MessageBox.Show("Apenas numeros e virgulas!", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void FormatarMoeda(object sender, KeyEventArgs e) { GunaLineTextBox txt = (GunaLineTextBox)sender; string valor = txt.Text.Replace("R$", "").Replace(",", "").Replace(" ", "").Replace("00,", ""); if (valor.Length == 0) { txt.Text = "0,00" + valor; } if (valor.Length == 1) { txt.Text = "0,0" + valor; } if (valor.Length == 2) { txt.Text = "0," + valor; } else if (valor.Length >= 3) { if (txt.Text.StartsWith("0,")) { txt.Text = valor.Insert(valor.Length - 2, ",").Replace("0,", ""); } else if (txt.Text.Contains("00,")) { txt.Text = valor.Insert(valor.Length - 2, ",").Replace("00,", ""); } else { txt.Text = valor.Insert(valor.Length - 2, ","); } } valor = txt.Text; txt.Text = string.Format("{0:C}", Convert.ToDouble(valor)); txt.Select(txt.Text.Length, 0); }
public void RetornarMascara(object sender, EventArgs e) { GunaLineTextBox txt = (GunaLineTextBox)sender; txt.Text = double.Parse(txt.Text).ToString("C2"); }
public void TirarMascara(GunaLineTextBox txt) { txt.Text = txt.Text.Replace("R$", "").Trim(); }
public void TirarMascaraEnter(object sender, EventArgs e) { GunaLineTextBox txt = (GunaLineTextBox)sender; txt.Text = txt.Text.Replace("R$", "").Trim(); }
private void TxtTc_Leave(object sender, EventArgs e) { GunaLineTextBox textBox = (GunaLineTextBox)sender; watermark.TexboxCikis(textBox.Tag.ToString(), textBox); //sifre uzunluk kontrol if (textBox.Name == TxtSifre.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, txtIslem.msj); IzinSifre = false; } else { ErrorFlash(textBox, string.Empty); IzinSifre = true; } } //email kontrol if (textBox.Name == TxtGmail.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, txtIslem.msj); IzinEmail = false; } else { ErrorFlash(textBox, txtIslem.msj); IzinEmail = true; } } //tc kontrol if (textBox.Name == TxtTc.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, txtIslem.msj); IzinTc = false; } else { ErrorFlash(textBox, txtIslem.msj); IzinTc = true; } } //şifre bezerlik kontorol if (textBox.Name == TxtSifreTekrar.Name) { if (!txtIslem.SifreBenzerlik(TxtSifre, textBox)) { ErrorFlash(textBox, "Şifreler Uyuşmuyor!"); IzinTekrarSifre = false; } else { ErrorFlash(textBox, string.Empty); IzinTekrarSifre = true; } } if (textBox.Name == TxtKulAdSoyad.Name || textBox.Name == TxtGizliSoruCevap.Name || textBox.Name == TxtSifreTekrar.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, "Bu alan boş olamaz!"); } else { ErrorFlash(textBox, string.Empty); } } }
private void TxtSifre_Leave(object sender, EventArgs e) { GunaLineTextBox textBox = (GunaLineTextBox)sender; watermark.TexboxCikis(textBox.Tag.ToString(), textBox); }
private void TxtTc_Leave(object sender, EventArgs e) { GunaLineTextBox textBox = (GunaLineTextBox)sender; watermark.TexboxCikis(textBox.Tag.ToString(), textBox); //mail kontrol if (textBox.Name == TxtGmail.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, txtIslem.msj); IzinEmail = false; } else { ErrorFlash(textBox, txtIslem.msj); IzinEmail = true; } } //tc kontrol if (textBox.Name == TxtTc.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, txtIslem.msj); IzinTc = false; } else { ErrorFlash(textBox, txtIslem.msj); IzinTc = true; } } //kontrol txt if (textBox.Name == TxtKulAdSoyad.Name || textBox.Name == TxtGizliSoruCevap.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, txtIslem.msj); IzinTxt = false; } else { IzinTxt = true; ErrorFlash(textBox, string.Empty); } } if (textBox.Name == TxtSifre.Name || textBox.Name == TxtSifreTekrar.Name) { if (!txtIslem.TxtKontorIslemi(textBox)) { ErrorFlash(textBox, txtIslem.msj); } else { ErrorFlash(textBox, string.Empty); } } }
public bool TxtKontorIslemi(GunaLineTextBox textBox) { //sifre uzunluk kontrol if (textBox.Name == "TxtSifre") { if (textBox.ForeColor == Color.DarkGray) { izin = false; msj = "Bu alan boş olamaz!"; } else if (textBox.Text.Length != 8) { izin = false; msj = "Şifre 8 Karakterden Oluşmalıdır!"; } else { izin = true; msj = string.Empty; } } //email kontrol if (textBox.Name == "TxtGmail") { if (textBox.ForeColor == Color.DarkGray) { izin = false; msj = "Bu alan boş olamaz!"; } else if (!Email_Format_Kontrol(textBox.Text)) { izin = false; msj = "E-mailiniz Doğru Formatta Değil!"; } else { izin = true; msj = string.Empty; } } //tc kontrol if (textBox.Name == "TxtTc") { if (textBox.ForeColor == Color.DarkGray) { izin = false; msj = "Bu alan boş olamaz!"; } else if (textBox.Text.Length != 11) { izin = false; msj = "T.C Kimlik Numarası 11 Karekter Olmalıdır!"; } else { izin = true; msj = string.Empty; } } if (textBox.Name == "TxtKulAdSoyad" || textBox.Name == "TxtGizliSoruCevap" || textBox.Name == "TxtSifreTekrar") { if (textBox.ForeColor == Color.DarkGray) { izin = false; msj = "Bu alan boş olamaz!"; } else { izin = true; msj = string.Empty; } } return(izin); }