By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Detect column in list box mouse click

P: n/a
With a multiple column listbox, I'd like to be able to change the sort
by allowing the user to click on a column. Is there a practical way
detect in which column the user clicked?

I know this could be done with a datasheet subform, but I was hoping to
be able to use the listbox.

Any suggestions?

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
May 5 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Randy Harris" <pl****@send.no.spam> schreef in bericht news:wP*******************@newssvr14.news.prodigy. com...
With a multiple column listbox, I'd like to be able to change the sort
by allowing the user to click on a column. Is there a practical way
detect in which column the user clicked?

I know this could be done with a datasheet subform, but I was hoping to
be able to use the listbox.

Any suggestions?


Hi Randy,

AFAIK you can't detect the column clicked with a listbox (at least I can't ...)
but I have an idea:
- Use a listbox *without* the columnheads
- Create 'columnheads' yourself (you could use labels for this)
Just place the labelcontrols above your listbox with the proper width and so on.
Use the columnnames for the caption (and backstyle normal, backcolor white)

This will look almost the same as a listbox with columnheads
Then you can use the click-event of the labels to do whatever you like

Arno R
May 5 '06 #2

P: n/a
See how it is done in this solution:
http://www.lebans.com/listboxcolumnresize.htm
ListBoxColumnResize.zip is a Class that allows the user to resize the
ColumnWidths of a ListBox at Runtime.Also supports an Autosizing method for
the ColumnWidths.

Version 2.2 April 27/2002

Modified Columns AutoSizing method to work with both ListBox and Combo
controls.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

"Randy Harris" <pl****@send.no.spam> wrote in message
news:wP*******************@newssvr14.news.prodigy. com...
With a multiple column listbox, I'd like to be able to change the sort by
allowing the user to click on a column. Is there a practical way detect in
which column the user clicked?

I know this could be done with a datasheet subform, but I was hoping to be
able to use the listbox.

Any suggestions?

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

May 5 '06 #3

P: n/a
Randy there is code/logic to handle that issue here:
http://www.lebans.com/listboxcolumnresize.htm
ListBoxColumnResize.zip is a Class that allows the user to resize the
ColumnWidths of a ListBox at Runtime.Also supports an Autosizing method for
the ColumnWidths.

Version 2.2 April 27/2002

Modified Columns AutoSizing method to work with both ListBox and Combo
controls.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

"Randy Harris" <pl****@send.no.spam> wrote in message
news:wP*******************@newssvr14.news.prodigy. com...
With a multiple column listbox, I'd like to be able to change the sort by
allowing the user to click on a column. Is there a practical way detect in
which column the user clicked?

I know this could be done with a datasheet subform, but I was hoping to be
able to use the listbox.

Any suggestions?

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

Jun 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.