472,373 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Customizing individual items in a list box - is it possible?

I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that
so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather
than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Thanks.
Nov 12 '05 #1
4 4971
On Thu, 26 Feb 2004 04:49:45 GMT, "Colleyville Alan"
<ae***********@nospam.comcast.net> wrote:
I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that
so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather
than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Thanks.


When I want something like that, I usually either fake it with a subform, or
use a ListView control. I try to avoid ActiveX controls when possible, so I
aim for the subform approach if I can, but the ListView is more flexible.
Nov 12 '05 #2
DFS
Here's a kludge that might work:

Create a 2nd listbox beside the first one, of the same height and just wide
enough to show an asterisk. Position the 2nd listbox very close to the
right edge of the 1st list. Then in the 2nd listbox, show the asterisk if
the item in the 1st listbox is already chosen.
"Colleyville Alan" <ae***********@nospam.comcast.net> wrote in message
news:FVe%b.407544$xy6.2326443@attbi_s02...
I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Thanks.

Nov 12 '05 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Besides what S.Jorgensen & DFS have to say - you can create 2
ListBoxes. One has the Available items and the other has the Selected
items. These are similar to selection boxes in the Report wizard -
selecting which fields from a table/query to display on the report -
and various other wizards (duplicates query, etc.).

I have a demo Acc97 .mdb file at http://home.earthlink.net/~mgf00/
(Select Items Between Two List Boxes) that you can download &
experiment with.

You could also just not show those items in the ListBox that are
already on the s/s. You'd have to requery the ListBox each time an
item was placed on the s/s and exclude the items this way:

SELECT ... FROM ...
WHERE itemID not in (<list of items IDs on s/s>)
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQD5HJIechKqOuFEgEQJB7wCffVwxr+Fzc3kzMEOhjxQuIZ/Mb2EAoMl7
DnrgvBBlBy5OVF5COijx1Jng
=BFp5
-----END PGP SIGNATURE-----
Colleyville Alan wrote:
I am trying to use a list box to allow users to select items, the results
are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that
so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather
than reducing it. Is it possible to format an individual row in a listbox
to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?


Nov 12 '05 #4
Thanks for the help

"MGFoster" <me@privacy.com> wrote in message
news:JG*****************@newsread2.news.pas.earthl ink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Besides what S.Jorgensen & DFS have to say - you can create 2
ListBoxes. One has the Available items and the other has the Selected
items. These are similar to selection boxes in the Report wizard -
selecting which fields from a table/query to display on the report -
and various other wizards (duplicates query, etc.).

I have a demo Acc97 .mdb file at http://home.earthlink.net/~mgf00/
(Select Items Between Two List Boxes) that you can download &
experiment with.

You could also just not show those items in the ListBox that are
already on the s/s. You'd have to requery the ListBox each time an
item was placed on the s/s and exclude the items this way:

SELECT ... FROM ...
WHERE itemID not in (<list of items IDs on s/s>)
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQD5HJIechKqOuFEgEQJB7wCffVwxr+Fzc3kzMEOhjxQuIZ/Mb2EAoMl7
DnrgvBBlBy5OVF5COijx1Jng
=BFp5
-----END PGP SIGNATURE-----
Colleyville Alan wrote:
I am trying to use a list box to allow users to select items, the results are queried based on the selection and written to a spreadsheet. If the
item already exists on their current spreadsheet, I'd like to indicate that so that they do not choose the same item a second time.

Right now, I have the listbox show those items that are already on the
spreadsheet using the selection property (selected = true). But that
actually increases the likelihood of an item being chosen by mistake rather than reducing it. Is it possible to format an individual row in a listbox to be a different color, or bold, or highlighted, etc without setting
"selected = true" and without affecting other rows?

Nov 12 '05 #5

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

Similar topics

0
by: mark | last post by:
Is there a way to customize certian list items within a ListBox? I want to change the backcolor and forecolor of items which meet predefined criteria.
5
by: hiroshi ochi | last post by:
Hello, Using MSIE 6.0 and above, with javascript is it possible to display an individual tooltip for each item in a listbox? I need this functionality to show the listitems that are longer...
0
by: Kam Mitchell | last post by:
I'm trying to create a listbox that justifies to the bottom right of the control. As items are added, they appear at the bottom of the list and the last item is always displayed at the bottom. ...
1
by: Eric Robishaw | last post by:
I'm adding items to a CheckBoxList Control, and need the text in each checkbox list item to be a specific color. Here's what I'm trying: ListItem li = new ListItem(GroupName, GroupID);...
2
by: Antoine | last post by:
I would like to construct my own list of items in a grid/ table/ item list layout but I have a problem. I want to add a sort of index row based on time, such as there might be blank values. Sure...
2
by: Brian Mitchell | last post by:
Is it possible to gray out individual items in the CheckedListBox? I have an option at the top of the list that simply says 'All', and when the user clicks that item I want the rest of the items in...
3
by: laredotornado | last post by:
Hi, On both Firefox and IE, how can I replace the bullets before unordered list items, with double arrows ">>" throughout my site? Thanks, - Dave
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the...
5
by: r3bol | last post by:
Hi, sorry to post this, but I've had a really hard time finding how to do it. Q. How can I break up a value in a list to a list of individual items (preferably without importing any modules)?...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.