Re: UserControl Static ComboBox
- From: "Mark Jerde" <MarkJerde@xxxxxxxxxxxxxxxx>
- Date: Wed, 27 Jul 2005 18:51:42 -0400
Nicholas -- Thanks, that works great.
-- Mark
"Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:em2rGpskFHA.2444@xxxxxxxxxxxxxxxxxxxxxxx
> Mark,
>
> Create a string array with your 40 entries and store that where all 40
> comboboxes can access it.
>
> Then, set the DataSource property on each combobox to that array.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> "Mark Jerde" <MarkJerde@xxxxxxxxxxxxxxxx> wrote in message
> news:%230tg1MrkFHA.1996@xxxxxxxxxxxxxxxxxxxxxxx
>> 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
>>
>>
>
>
.
- References:
- UserControl Static ComboBox
- From: Mark Jerde
- Re: UserControl Static ComboBox
- From: Nicholas Paldino [.NET/C# MVP]
- UserControl Static ComboBox
- Prev by Date: Renaming Files using Path.Combine
- Next by Date: thread abort ignored when GUI created and run in process
- Previous by thread: Re: UserControl Static ComboBox
- Next by thread: Webform with NO IE toolbar (just ie window) possible?
- Index(es):
Relevant Pages
|