Thread: Redraw problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Greg Lovern Greg Lovern is offline
external usenet poster
 
Posts: 224
Default Redraw problem

I have a single combobox that I move around, repopulate, and make
visible or invisible, depending on what cell or cells the user
selects. Works fine except this problem:

If the user holds an arrow key down, so that the active cell is moved
quickly across columns, and the macro makes the combobox appear on
some of those columns and disappear on others, and then the user
releases the arrow key and lands on a column for which the combobox is
made to disappear, sometimes the combobox remains visible on the last
column for which it was made visible.

I've checked to ensure that screenupdating wasn't inadvertently left
off, and it was not. I've verified that screenupdating is turned *on*
when this happens.

If I scroll the sheet a page or two away, so that the combobox
disappears, then scroll back, I no longer see the combobox, indicating
that Excel did a redraw making the combobox invisible.

Or, if I just enter anything in the active cell, the combobox
disappears, also indicating that Excel did a redraw making the
combobox invisible.

Any suggestions? Would it be a bad idea to try to use the Win32 API
function RedrawWindow on Excel, and if so, what parameters? I haven't
used that one before and if there is a working sample out there that
make Excel redraw, I'd sure rather start with that.


(BTW, in case you're wondering why we're not using Excel's validation
dropdowns instead: we were, but the users hated them because you can't
type in the value if you know it and enter it a hundred times a day;
instead you must always use the mouse. That's extremely frustrating
for users who do a lot of data entry. Using the combobox control
solves that problem, and also provides auto-complete, which those
users also want. To avoid having millions of comboboxes, I move a
single one around and repopulate it etc. as necessary.)


Thanks,

Greg