Executing an Image Button Click event when a Text Box changes

see07

Regular
Joined
Apr 16, 2004
Messages
78
Location
Mexico City
Hello!!

I want when a user click enter key in a Text Box, event Image Button Click be executed, I’m using this code:

private void TextBox1_TextChanged(object sender, System.EventArgs e)
{
ImageButton1_Click(sender,e);
}

…but when I compile my project I’m receiving error CS1502 “Argument ‘2’ can not convert from ‘System.EventArgs’ to ‘System.UI.ImageClickEventArgs’.

If I change Image Button for a Button and put this code:

private void TextBox1_TextChanged(object sender, System.EventArgs e)
{
Button2_Click(sender,e);
}

…no one error is generated and script is working O.K.

What I need to change in first code to also with an Image Button script work O.K.?

I’ll appreciate all your suggestions.

A.L.
 
Hello everybody:

Finally I got the solution:

private void TextBox1_TextChanged(object sender, System.EventArgs e)
{
ImageButton1_Click(null,null);
}

I hope this be useful to somebody.
Thanks all reply my thread.

A.L.
 
Back
Top