UserControl Static ComboBox
I'm not finding help in Google. VS .NET 2003.
I have a user control with a ComboBox. At runtime the ComboBox gets loaded
with a long list of strings. Since I have up to 40 controls on a form I'm
trying to figure out a way for all 40 combobox controls to share the same
list of items.
The ComboBox.Items property is read only so setting all 40 to the same
ObjectCollection won't work.
On a whim I made the combobox static in the UC:
private static System.Windows.Forms.ComboBox cboFields;
This "works" from a data standpoint, as Items.innerlist is the same (and
correct) in all 40 UCs after initializing the first one. But it doesn't
work from the UI standpoint. The ComboBox control doesn't like being shared
across multiple UCs.
Suggestions? Or is there no alternative to haviing the same Items in all 40
instances?
Thanks.
-- Mark
.
Relevant Pages
- Re: Combobox Display Problem
... ' Find the record that matches the control. ... Header section of the form (subform), ... text field containing the Item Names, the Combobox comes up empty. ... (microsoft.public.access.forms) - ActiveX Combo reagiert nicht auf TAB Key
... Das ActiveX ist ein MFC ActiveX geplant für VB 6.0 Anwendung Es ist ... Ich habe das Control in eine VB Form mit einigen Anderen Controls eingebaut ... den Cursor in das Editfeld stellt, aber die Combobox dadurch nicht als das ... (microsoft.public.de.vc) - Re: VBA search coding problem -- Combobox Example
... Use a combobox to pick the code and then they can only choose one that DOES exists ... a control to be used for searching will be unbound, so whatever record is on the screen will not be changed. ... using ID in the fieldname implies that fieldname was created using an autonumber field in the main table and is defined to be a long integer in related tables. ... For instance, if you have a People table, define a PID autonumber field. ... (microsoft.public.access.modulesdaovba) - Re: VBA search coding problem -- Combobox Example
... a control to be used for searching will be unbound, ... using a combobox will solve this ... fieldname was created using an autonumber field in the main table and is ... For instance, if you have a People table, define a PID ... (microsoft.public.access.modulesdaovba) - Re: Derived UserCcontrol base controls design time behavior
... FeeTypeID setter not because the combobox is not created, ... I have exposed get and set property to access the comboboxes SelectedValue ... The combobo is prepopulated in control FeesBase contructor ... Code generation for property 'FeeTypeID' failed. ... (microsoft.public.dotnet.framework.windowsforms) |
|