473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can i get the value of dynamically generated combobox control

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

Nov 15 '05 #1
1 3070
Hello

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

Best regards,

Sherif

"Shayer" <sh*******@hotmail.com> wrote in message
news:#V**************@tk2msftngp13.phx.gbl...
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

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stefan De Schepper | last post by:
Hi all, I am trying to make an "allround" combobox, being able to just be a combobox or an imagecombo. The appearance of this control can be either 3D or flat. The control is based on...
0
by: Ryan Liu | last post by:
I think there are two way to define user control. For example, I want to define a ComoBox with contains only AM, PM items. a.. One way I define a class extends...
0
by: Peter Zuber | last post by:
Hi NG We want to load controls dynamically and create them on a WinForm. Doing so, we seem to loose type information. The scenario is as follows: The class MANCombobBox inherits from ComboBox...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
6
by: Nathan Sokalski | last post by:
I am trying to dynamically add controls to my page, but am having trouble with controls such as buttons. I have been able to add simple controls such as Label controls, because they can be placed...
7
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
2
by: Nathan Sokalski | last post by:
There are many situations in which we want to assign certain styles with multiple CSS properties to a control, quite often the same ones for multiple controls. Sometimes these styles must be...
1
by: tssutha | last post by:
hi all, I have problem when creating comboBox dynamically. i Could not change the size of the combobox whenb add this control to a ToolBar.. here is the code... private void...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.