C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




user control in c#


Posted Date: 18 Jun 2008      Total Responses: 1

Posted By: PalaniNathan       Member Level: Gold     Points: 1



windows form C#
i have a user contol for numeric text box
i am using it in my form1
i want to rise keypress event in user contol instead of form1
please give me the solution. very urgent





Responses

Author: ajay    18 Jun 2008Member Level: BronzeRating:     Points: 2

Just write this code in ur user control for that particula control
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{


if (!((e.KeyChar >= 48 && e.KeyChar <= 57) || e.KeyChar == 8))
{
e.Handled = true;
MessageBox.Show("Please enter Numbers", "Communication Equipment Inventory", MessageBoxButtons.OK, MessageBoxIcon.Information);

}

}



Post Reply
You must Sign In to post a response.
Next : Change the location of control at runtime in WPF application.
Previous : equation to Math ML
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use