How will U encapsulate button trigger event into text_box
event of Pressing Enter key?i.e only after pressing Enter
after the text is typed the button trigger event should
activate?

Answer Posted / varun sharma

This should possibly do the trick for purpose

protected void Button1_KeyDown(object sender, EventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
Button_Click(null, null);
}
}


protected void Button_Click(object sender, EventArgs e)
{

}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are callback methods in c#?

684


What is icollection in c#?

694


What is an array? Give the syntax for a single and multi-dimensional array?

670


What is the execution entry point for a c# console application?

728


Can you declare a class or a struct as constant?

743


How do I run managed code in a process?

712


What is check/uncheck?

806


What is the difference between static and private constructor?

699


What happens if you add duplicate elements to a set?

680


What is yield c#?

646


Does the system.exception class have any cool features?

691


Can I fly with a loop recorder?

654


Can dictionary have duplicate keys c#?

668


What is the main purpose of linq?

662


What is managed or unmanaged code?

843