ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ListBox has 2 rows highlighted (https://www.excelbanter.com/excel-programming/298603-listbox-has-2-rows-highlighted.html)

L Mehl

ListBox has 2 rows highlighted
 
Hello --

A form contains 2 listboxes.

Listbox1's MultiSelect property is set to
frmMultiSelectSingle.

The choice from that listbox is used to populate Listbox2.

If the choice in Listbox1 results in Listbox2 having no records, clicking a
different choice in Listbox1 highlights both the original choice and the
second one.

Is there a setting or code I need to add to allow only one choice (or, none)
in Listbox 1 to be highlighted?

Thanks for any help.

Larry Mehl



Dave Peterson[_3_]

ListBox has 2 rows highlighted
 
It sounds like it's a display problem.

Maybe you could verify it with a line like:

MsgBox Me.ListBox1.ListIndex

And if maybe you could refresh the user form with a line like:

Me.Repaint





L Mehl wrote:

Hello --

A form contains 2 listboxes.

Listbox1's MultiSelect property is set to
frmMultiSelectSingle.

The choice from that listbox is used to populate Listbox2.

If the choice in Listbox1 results in Listbox2 having no records, clicking a
different choice in Listbox1 highlights both the original choice and the
second one.

Is there a setting or code I need to add to allow only one choice (or, none)
in Listbox 1 to be highlighted?

Thanks for any help.

Larry Mehl


--

Dave Peterson


L Mehl

ListBox has 2 rows highlighted
 
Thanks Dave


"Dave Peterson" wrote in message
...
It sounds like it's a display problem.

Maybe you could verify it with a line like:

MsgBox Me.ListBox1.ListIndex

And if maybe you could refresh the user form with a line like:

Me.Repaint





L Mehl wrote:

Hello --

A form contains 2 listboxes.

Listbox1's MultiSelect property is set to
frmMultiSelectSingle.

The choice from that listbox is used to populate Listbox2.

If the choice in Listbox1 results in Listbox2 having no records,

clicking a
different choice in Listbox1 highlights both the original choice and the
second one.

Is there a setting or code I need to add to allow only one choice (or,

none)
in Listbox 1 to be highlighted?

Thanks for any help.

Larry Mehl


--

Dave Peterson




L Mehl

ListBox has 2 rows highlighted
 
Adding
MsgBox Me.ListBox1.ListIndex
at the start of the listbox Click event
displays only 1 integer in the msgbox (0,1,2,...)
So, the system thinks only one listbox entry is highlighted, when two are
highlighted.

Me.Repaint has no effect when added at the end of the listbox Click event.
Is that where you thought I should put it?

Thanks for any additional help.

L Mehl

"Dave Peterson" wrote in message
...
It sounds like it's a display problem.

Maybe you could verify it with a line like:

MsgBox Me.ListBox1.ListIndex

And if maybe you could refresh the user form with a line like:

Me.Repaint





L Mehl wrote:

Hello --

A form contains 2 listboxes.

Listbox1's MultiSelect property is set to
frmMultiSelectSingle.

The choice from that listbox is used to populate Listbox2.

If the choice in Listbox1 results in Listbox2 having no records,

clicking a
different choice in Listbox1 highlights both the original choice and the
second one.

Is there a setting or code I need to add to allow only one choice (or,

none)
in Listbox 1 to be highlighted?

Thanks for any help.

Larry Mehl


--

Dave Peterson




Dave Peterson[_3_]

ListBox has 2 rows highlighted
 
There was a post a little bit ago about a list box showing duplicated values in
the list when scrolling down.

I remember that it was a pain to workaround.

Maybe you can use some of the code to repopulate the list each time it changes.

http://groups.google.com/groups?thre...4738%40msn.com

L Mehl wrote:

Adding
MsgBox Me.ListBox1.ListIndex
at the start of the listbox Click event
displays only 1 integer in the msgbox (0,1,2,...)
So, the system thinks only one listbox entry is highlighted, when two are
highlighted.

Me.Repaint has no effect when added at the end of the listbox Click event.
Is that where you thought I should put it?

Thanks for any additional help.

L Mehl

"Dave Peterson" wrote in message
...
It sounds like it's a display problem.

Maybe you could verify it with a line like:

MsgBox Me.ListBox1.ListIndex

And if maybe you could refresh the user form with a line like:

Me.Repaint





L Mehl wrote:

Hello --

A form contains 2 listboxes.

Listbox1's MultiSelect property is set to
frmMultiSelectSingle.

The choice from that listbox is used to populate Listbox2.

If the choice in Listbox1 results in Listbox2 having no records,

clicking a
different choice in Listbox1 highlights both the original choice and the
second one.

Is there a setting or code I need to add to allow only one choice (or,

none)
in Listbox 1 to be highlighted?

Thanks for any help.

Larry Mehl


--

Dave Peterson


--

Dave Peterson


L Mehl

ListBox has 2 rows highlighted
 
Thanks Dave --

I'll check it out.

Larry

"Dave Peterson" wrote in message
...
There was a post a little bit ago about a list box showing duplicated

values in
the list when scrolling down.

I remember that it was a pain to workaround.

Maybe you can use some of the code to repopulate the list each time it

changes.

http://groups.google.com/groups?thre...4738%40msn.com

L Mehl wrote:

Adding
MsgBox Me.ListBox1.ListIndex
at the start of the listbox Click event
displays only 1 integer in the msgbox (0,1,2,...)
So, the system thinks only one listbox entry is highlighted, when two

are
highlighted.

Me.Repaint has no effect when added at the end of the listbox Click

event.
Is that where you thought I should put it?

Thanks for any additional help.

L Mehl

"Dave Peterson" wrote in message
...
It sounds like it's a display problem.

Maybe you could verify it with a line like:

MsgBox Me.ListBox1.ListIndex

And if maybe you could refresh the user form with a line like:

Me.Repaint





L Mehl wrote:

Hello --

A form contains 2 listboxes.

Listbox1's MultiSelect property is set to
frmMultiSelectSingle.

The choice from that listbox is used to populate Listbox2.

If the choice in Listbox1 results in Listbox2 having no records,

clicking a
different choice in Listbox1 highlights both the original choice and

the
second one.

Is there a setting or code I need to add to allow only one choice

(or,
none)
in Listbox 1 to be highlighted?

Thanks for any help.

Larry Mehl

--

Dave Peterson


--

Dave Peterson





All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com