How can i get the value of dynamically generated combobox control

  • Thread starter Thread starter Shayer
  • Start date Start date
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
 
Hello

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

Best regards,

Sherif
 
Back
Top