Hi Patrick
I would do it like this:
// this is created at runtime... maybe in onLoad or by another function....
Button someButton = new Button();
someButton.Name = "OnlyCallFuncti onOne";
someButton.Clic k += new EventHandler( DynamicButton_C lick );
Button someOtherButton = new Button();
someOtherButton .Name = "OnlyCallFuncti onTwo";
someOtherButton .Click += new EventHandler( DynamicButton_C lick );
// then you have the Click function
private void DynamicButton_C lick( object sender, EventArgs e )
{
Button btn = (Button)sender;
switch( btn.Name )
{
case "OnlyCallFuncti onOne": this.FunctionOn e(); break;
case "OnlyCallFuncti onTwo": this. FunctionTwo(); break;
}
}
private void FunctionOne()
{
// Some code...
}
private void FunctionTwo()
{
// Some code...
}
I just noticed you said ImageButton.... . it should work just the same.
Hope it helps... did it in C# since u did not specify any other
language....the n again i only use c# (^_^)
"Patrick Marti" <Pa**********@d iscussions.micr osoft.com> wrote in message
news:6C******** *************** ***********@mic rosoft.com...
Is it possible to call a function from a ImageButton wich I create
at runtime?
That would be really interesting
Many thanks for any suggest.
Greetings Patrick Marti