Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Problem displaying a listbox over a combobox

This is a pretty weird one and a little hard to describe ... but I'm going
to try.

My add-in sometimes places a combobox onto the user's worksheet. In
response to a click of an image control also on the worksheet, the code may
dynamically pop-up a listbox on the worksheet. Depending on many factors,
the listbox may get popped up in a location where it overlaps the combobox.

As long as no entry in the combobox is selected (i.e., no entry in the
combobox is highlighted) then everything works fine. However, if one of the
entries in the combobox is selected (i.e., the entry is highlighted) when
the user clicks the image control and the listbox happens to overlap this
combobox, then the rendering of the listbox is messed up. Its almost as if
the combobox entry is bleeding through. If the user first clicks a cell of
the worksheet (thus unselecting the contents of the combobox) before
clicking the image control then everything works fine.

This problem occurs on Excel 97 - 2003.

I've tried programmatically setting the zorder when popping up the listbox
(lstBox.ShapeRange(1).ZOrder msoBringToFront) and that didn't help.

I've tried programmatically selecting a cell on the worksheet to undo the
selection in the combobox (Selection.Select or Selection.Activate) and that
didn't help.

I select and active the listbox (lstBox.Select, lstBox.Activate) and that
doesn't help.

SetFocus doesn't seem to be supported for listbox controls on worksheets.

Argh!

Any suggestions?

TIA,

josh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Problem displaying a listbox over a combobox

Josh,

Just a couple of ideas (untested) you could try out...

1. Set the visible property of the combobox to false when you show the listbox.
2. Show the listbox in a column that will not overlap the combobox
and use ScrollColumn property of the sheet to position it so the
list box will be seen.

Regards,
Jim Cone
San Francisco, CA


"Josh Sale" <jsale@tril dot cod wrote in message ...
This is a pretty weird one and a little hard to describe ... but I'm going
to try.
My add-in sometimes places a combobox onto the user's worksheet. In
response to a click of an image control also on the worksheet, the code may
dynamically pop-up a listbox on the worksheet. Depending on many factors,
the listbox may get popped up in a location where it overlaps the combobox.
As long as no entry in the combobox is selected (i.e., no entry in the
combobox is highlighted) then everything works fine. However, if one of the
entries in the combobox is selected (i.e., the entry is highlighted) when
the user clicks the image control and the listbox happens to overlap this
combobox, then the rendering of the listbox is messed up. Its almost as if
the combobox entry is bleeding through. If the user first clicks a cell of
the worksheet (thus unselecting the contents of the combobox) before
clicking the image control then everything works fine.
This problem occurs on Excel 97 - 2003.
I've tried programmatically setting the zorder when popping up the listbox
(lstBox.ShapeRange(1).ZOrder msoBringToFront) and that didn't help.
I've tried programmatically selecting a cell on the worksheet to undo the
selection in the combobox (Selection.Select or Selection.Activate) and that
didn't help.
I select and active the listbox (lstBox.Select, lstBox.Activate) and that
doesn't help.
SetFocus doesn't seem to be supported for listbox controls on worksheets.
Argh!
Any suggestions?
TIA,
josh


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Problem displaying a listbox over a combobox

Thanks Jim. Setting the visible property of the combobox did the trick!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox v Listbox MBlake New Users to Excel 5 April 24th 05 11:58 AM
Combobox/listbox FSt1 Excel Discussion (Misc queries) 3 January 4th 05 06:55 PM
ComboBox & ListBox problem unplugs[_19_] Excel Programming 9 June 22nd 04 08:45 AM
Combobox or Listbox Kathy[_7_] Excel Programming 2 December 4th 03 03:48 PM
listbox-combobox category GUS Excel Programming 1 September 12th 03 04:52 PM


All times are GMT +1. The time now is 12:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"