and also in other textboxes it should allow other than special characters
and also i tried to print the text in the textboxes in a label but i got like this
(apple boy cat doll)
but i want like below
apple
boy
cat
doll
please tell me how to do this?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Oct 20, 2010, 7:46 AM EDT
or
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { int charCode = Convert.ToInt32(e.KeyChar); if (charCode == 3 || charCode == 22) { MessageBox.Show("Copy/Cut Paste not allowed"); e.Handled = true; }if (char.IsDigit(e.KeyChar) == false & char.IsControl(e.KeyChar) == false) { e.Handled = true; MessageBox.Show("Not Valid Entry !", "Validion", MessageBoxButtons.OK); } }Sam HobbsRank #107 · 20.5K reputationPosted Oct 20, 2010, 12:32 PM EDT
Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Oct 21, 2010, 12:24 AM EDT
use the below code
try
{
if (txtage.Text != "" && txtage.Enabled)
{
Convert.ToInt32(txtage.Text);
}
}
catch (Exception ex)
{
RadMessageBox.Show("enter valid data");
txtage.Text = "";
}