473,385 Members | 2,013 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,385 software developers and data experts.

what property or method should I use in combo box to

User is going to be transferring items out of combobox to listbox and
vice versa keeping ascending and desending order respectively at all
time.

If user selects the last item in combobox, the program is supposed to
display a message box stating that there is no more item in the
combobox with OK button to be clicked as the only option and upon
clicking OK, the program should terminate, i.e the program should check
to ensure that the ComboBox contains at least one item.

What property or method should I use to check that the user has
selected the last item left in combo box? Or should I just keep track
of the count of items and when the last one is selected, display the
message and terminate the program?

Nov 3 '06 #1
7 1714
Never mind. Got that part.

Now, how do I set descending order for list box?

Nov 3 '06 #2
There are 2 cases
1) Use Array.Sort + Array.Reverse
2) Override ListBox.Sort in custom class inherited from ListBox

--
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


"Amanda" wrote:
Never mind. Got that part.

Now, how do I set descending order for list box?

Nov 3 '06 #3

Michael Nemtsev wrote:
There are 2 cases
1) Use Array.Sort + Array.Reverse
2) Override ListBox.Sort in custom class inherited from ListBox
We can't use array in this assignment yet. No inheritance either.
>
--
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


"Amanda" wrote:
Never mind. Got that part.

Now, how do I set descending order for list box?
Nov 3 '06 #4
Hello Amanda,

How do u fill up the ListBox? With DataSet/DataTable?

AMichael Nemtsev wrote:
A>
>There are 2 cases
1) Use Array.Sort + Array.Reverse
2) Override ListBox.Sort in custom class inherited from ListBox
AWe can't use array in this assignment yet. No inheritance either.
A>
>--
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

"Amanda" wrote:
>>Never mind. Got that part.

Now, how do I set descending order for list box?
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Nov 3 '06 #5

Michael Nemtsev wrote:
Hello Amanda,

How do u fill up the ListBox? With DataSet/DataTable?
Data is placed at design time in combo box. At runt ime, move back and
forth (as long as at leats one entry is left in combo box) to the list
box but the data must be in descending order in list box at all time.

I set sort property to true in design time for both combo and list box
which by default, it seems is ascending order.
>
AMichael Nemtsev wrote:
A>
There are 2 cases
1) Use Array.Sort + Array.Reverse
2) Override ListBox.Sort in custom class inherited from ListBox
AWe can't use array in this assignment yet. No inheritance either.
A>
--
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

"Amanda" wrote:

Never mind. Got that part.

Now, how do I set descending order for list box?
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Nov 3 '06 #6
Hello Amanda,

There is no other way for desc sort except I described -data sort or override
Sort of ListBox control

AMichael Nemtsev wrote:
A>
>Hello Amanda,

How do u fill up the ListBox? With DataSet/DataTable?
AData is placed at design time in combo box. At runt ime, move back
Aand forth (as long as at leats one entry is left in combo box) to the
Alist box but the data must be in descending order in list box at all
Atime.
A>
AI set sort property to true in design time for both combo and list
Abox which by default, it seems is ascending order.
A>
>AMichael Nemtsev wrote:
A>
>>>There are 2 cases
1) Use Array.Sort + Array.Reverse
2) Override ListBox.Sort in custom class inherited from ListBox
AWe can't use array in this assignment yet. No inheritance either.
A>
>>>--
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its
opponents
do not cease to be insipid." (c) Friedrich Nietzsche
"Amanda" wrote:

Never mind. Got that part.
>
Now, how do I set descending order for list box?
>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Nov 3 '06 #7

Michael Nemtsev wrote:
Hello Amanda,

There is no other way for desc sort except I described -data sort or override
Sort of ListBox control
Thanks.

>
AMichael Nemtsev wrote:
A>
Hello Amanda,

How do u fill up the ListBox? With DataSet/DataTable?
AData is placed at design time in combo box. At runt ime, move back
Aand forth (as long as at leats one entry is left in combo box) to the
Alist box but the data must be in descending order in list box at all
Atime.
A>
AI set sort property to true in design time for both combo and list
Abox which by default, it seems is ascending order.
A>
AMichael Nemtsev wrote:
A>
There are 2 cases
1) Use Array.Sort + Array.Reverse
2) Override ListBox.Sort in custom class inherited from ListBox
AWe can't use array in this assignment yet. No inheritance either.
A>

--
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its
opponents
do not cease to be insipid." (c) Friedrich Nietzsche
"Amanda" wrote:

Never mind. Got that part.

Now, how do I set descending order for list box?

---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Nov 3 '06 #8

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

Similar topics

1
by: Vilem Sova | last post by:
I want to use a user-defined object in the 'Add' method to add items to a combo box. The help documentation says that if you use an object in the add method then the object's 'ToString' method is...
3
by: ScottBH | last post by:
Discovered a fun one that I thought I should share, and hopefully catch Microsoft's attention to update some documentation. I'm a bit new to VB.NET, and was struggling with getting a combo box to...
8
by: VB User | last post by:
I would like the text property of combo box to read the first item of the list on form load. I have a set of four items in the collection. How do I do it? Thanks
0
by: Steph | last post by:
Hello, First, i'm french.... so my english isn't very good. I use the propertygrid control to edit an object that I have created (class) which represents a record of table in a database.Some...
2
by: jerry.ranch | last post by:
I've been using row source with the QBE for my list and combo boxes..when would I use control source? jerry
5
by: simonsmith987 | last post by:
I am displaying a list of properties on my GUI. All the properties have combo boxes that shouldn't be allowed to be edited. At the minute this works fine for bool values, see the code below for...
0
by: mirandacascade | last post by:
Using Access 2003. For this application when one enters data and clicks a command button, code gets run that does the following: For 5 different combo box controls: - create a querydef -...
1
by: Looch | last post by:
Hi All, Aside from code logic (if then, bool variables), is there a way to set a combo box click method to only execute when the index (text) is actually changed by a mouse click? I've changed...
14
by: Just_a_fan | last post by:
In VB6, I could easily take the value from a combo box and make a command with it, this: baudrate = cboBaud(listindex). With the new dotted stuff in VB9, I can't seem to do that. Here's an...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
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...

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.