How can i get the value of dynamically generated combobox control

S

Shayer

Hello

I have generated a dynamically generate combobox in C# win forms

How can i get the selected value of this combobox after a click event in
the runtime
Any help . I write the following code to generate the comboo .

ComboBox a=new ComboBox();

a.Location= new System.Drawing.Point(x,y);

a.Name="txt"+strFieldName;

a.Size = new System.Drawing.Size(100,20);

this.Controls.Add(a);



Thanks

Regards

Shayer
 
S

Sherif ElMetainy

Hello

Make the ComboBox object a field in you class instead of a local variable.

Best regards,

Sherif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top