views:

63

answers:

2

HI, Am on creation of touch screen UI system.And am generating button for selecting products

Under certain category.

--> array of button creating dynamically And placing in TABPAGE when user selects Tab for category. The button will be created with the name of products, Under the category selected.

{ 'the way am creating controls. mybutton(j) = new button() mybutton(j).top = 100 }

How can i get the Click event of those buttons-( in the array)....??

+1  A: 

You can use the += operator to assign a handler to an event, for example:

myButton.Click += ButtonClick;

and then declare it like this:

public void ButtonClick(object sender, EventArgs e)
{
    // ...
}

Alternatively, if the code is short, you may like to specify it right there directly, for example:

myButton.Click += (sender, e) =>
{
    // ...
}

The advantage of that latter method is that you can capture outside variables, such as for example the array of buttons and the index of this particular button.

Timwi
sorry, i dint get this..!! Am using VB.NEt
pvaju896
@pvaju896: Next time you ask a question about VB.NET, **don’t tag it as c#.** (Duh.)
Timwi
A: 

Hi,

Have a look at this link. http://forums.asp.net/p/1583639/3997438.aspx

Add button into the list and create a event for that.

Geetha
ThanX a lot. Saved my day..!!
pvaju896