Hi,
I am new to .Net.
I am using a Combo Box in my windows forms. I am adding the items by
creating the instances and adding the same to the list.
My questions/doubts are:
1. If I have 25 to 30 options in each combo box and like that if we have 6
or 7 combo boxes in a form, isnt it a problem in creating that number of
instances everytime the form is opened/activated
2. How do I dispose the Combo Box items.
Your comments/response is greatly appreciated.
thanks
vb 6 2671
Svae the datasource in a module or a shared property as a class. Then, just
set the datasource of the combobox to this value - set the displaymember and
valuemember properties accordingly.
You're abosultely right though - reloading this each time is a pig - but if
you just load a dataset at init and then use a shared property, you're good
to go.
--
W.G. Ryan MVP (Windows Embedded)
TiBA Solutions www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"vb" <vb@discussions .microsoft.com> wrote in message
news:CA******** *************** ***********@mic rosoft.com... Hi, I am new to .Net.
I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to 30 options in each combo box and like that if we have 6 or 7 combo boxes in a form, isnt it a problem in creating that number of instances everytime the form is opened/activated 2. How do I dispose the Combo Box items.
Your comments/response is greatly appreciated.
thanks vb
Svae the datasource in a module or a shared property as a class. Then, just
set the datasource of the combobox to this value - set the displaymember and
valuemember properties accordingly.
You're abosultely right though - reloading this each time is a pig - but if
you just load a dataset at init and then use a shared property, you're good
to go.
--
W.G. Ryan MVP (Windows Embedded)
TiBA Solutions www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"vb" <vb@discussions .microsoft.com> wrote in message
news:CA******** *************** ***********@mic rosoft.com... Hi, I am new to .Net.
I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to 30 options in each combo box and like that if we have 6 or 7 combo boxes in a form, isnt it a problem in creating that number of instances everytime the form is opened/activated 2. How do I dispose the Combo Box items.
Your comments/response is greatly appreciated.
thanks vb
VB,
When there is used a datagridcombobo xcolomn, than there are mostly a lot
more comboboxes as you now tell on a form.
I never heard a complain in this newsgroup.
Never think about disposing when you do not need to do it, it can be usefull
to clear bitmaps something faster because they are mostly huge
memoryspenders.
Relaeasing resources is one of the reasons dotNet is made.
Just my thought,
Cor
"vb" <vb@discussions .microsoft.com> Hi, I am new to .Net.
I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to 30 options in each combo box and like that if we have 6 or 7 combo boxes in a form, isnt it a problem in creating that number of instances everytime the form is opened/activated 2. How do I dispose the Combo Box items.
Your comments/response is greatly appreciated.
thanks vb
VB,
When there is used a datagridcombobo xcolomn, than there are mostly a lot
more comboboxes as you now tell on a form.
I never heard a complain in this newsgroup.
Never think about disposing when you do not need to do it, it can be usefull
to clear bitmaps something faster because they are mostly huge
memoryspenders.
Relaeasing resources is one of the reasons dotNet is made.
Just my thought,
Cor
"vb" <vb@discussions .microsoft.com> Hi, I am new to .Net.
I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to 30 options in each combo box and like that if we have 6 or 7 combo boxes in a form, isnt it a problem in creating that number of instances everytime the form is opened/activated 2. How do I dispose the Combo Box items.
Your comments/response is greatly appreciated.
thanks vb
"vb" <vb@discussions .microsoft.com> schrieb: I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to 30 options in each combo box and like that if we have 6 or 7 combo boxes in a form, isnt it a problem in creating that number of instances everytime the form is opened/activated
What problems do you think of? There may be performance problems if you are
adding hundreds of items when the form is shown, and maybe there will be
memory problems if you are adding a large number of elements.
2. How do I dispose the Combo Box items.
Simply remove them from the combobox and dispose them, if they implement
'IDisposable'.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
"vb" <vb@discussions .microsoft.com> schrieb: I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to 30 options in each combo box and like that if we have 6 or 7 combo boxes in a form, isnt it a problem in creating that number of instances everytime the form is opened/activated
What problems do you think of? There may be performance problems if you are
adding hundreds of items when the form is shown, and maybe there will be
memory problems if you are adding a large number of elements.
2. How do I dispose the Combo Box items.
Simply remove them from the combobox and dispose them, if they implement
'IDisposable'.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: 6thirty |
last post by:
Hi,
I've created a stocktaking database using Access XP. This is indexed by two
fields - part number and shelf location.
I am currently inputting all the data via a form. When I have entered a
record such as:
part number 202354-001
location C1-01
|
by: Gav |
last post by:
I am using VS 2005 and am trying to add items to a combo box using C#. I
know how to add simple text items but I am trying to add a value and some
text ie.
Value Text
A First Text
B Second Text
I've seen examples of ListItem but I can't seem to get this to work, can
anybody offer any advice.
|
by: vb |
last post by:
Hi,
I am new to .Net.
I am using a Combo Box in my windows forms. I am adding the items by
creating the instances and adding the same to the list.
My questions/doubts are:
1. If I have 25 to 30 options in each combo box and like that if we have 6
or 7 combo boxes in a form, isnt it a problem in creating that number of
instances everytime the form is opened/activated
2. How do I dispose the Combo Box items.
|
by: Juan Pedro Gonzalez |
last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on
VisualStudio's toolbar.
I've been able to find some VB 6 samples, but the placeholder option is no
longer available for ToolbarButtons...
Does anyone know how this could be done?
Looking forward to hear from you,
|
by: stinehelferw |
last post by:
I need a right-click menu on a form list control with combobox
controls.
I used View->Toolbars->Customize to create a toolbar.
I added ComboBox through commands tab.
I set properties to Popup making it a shortcut menu.
I have no problem linking it to the list control.
The menu comes up when I right-click the list control.
| |
by: mollyf |
last post by:
I've got a combo box that I want to bind a collection to. I got the
error "Complex Data Binding accepts as a data source either an IList or
an IListSource" so I tried using the BindingSource, which works except
when I want to have a blank line as the first item in the combo
box--then all that is displayed is the type of object.
Here is the code for filling the collection:
Public Function GetCollection(ByRef cndb As SqlConnection,...
|
by: The Eclectic Electric |
last post by:
I'd be very grateful if anyone could help me with this. From my limited
knowledge of Javascript I don't think it is possible, but I'll punt anyway.
I downloaded and very slightly adapted this guy's Javascript "combo box" -
http://sandy.mcarthur.org/javascript/select/select.html. It allows my users
(when I get some!) to select from a list of preexisting options and also to
add a new one by clicking on "add new". Essentially it's a select...
|
by: imwhiteandnerdy |
last post by:
i'm hoping I can get some help with adding my combo box selection to my access database.Any Help would be appreciated.
I've been told I need complex binding Basically I just want to add the selection to the database field
DATABASE =cc TABLE =customer FIELD IN DATABASE= custCity
COMBO BOX =cboCity
My combo box name is cboCity
Has the following collection of items linked
|
by: =?Utf-8?B?Y2RtdW5veg==?= |
last post by:
I have created a sub routine to programmatically add an indefinite number of
combo boxes to a form. The combo boxes are bound in code to a view for
displaying the available options. This routine works good until you add the
second combo box. At that point it changes the first combo box's selected
item. A third changes the second and first and so on. I've tried setting
the combo box name and tag to a unique name, but that doesn't help. ...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |