How to force an MSI dialog to repaint
November 21, 2008 12:13 PM
Subscribe
How to force Windows Installer (MSI) to redraw a listbox?
So we want to allow our users to set n configurations when they install our product. Each configuration is keyed to a value in a list box. The installer dialog, as designed, gives the user a listbox displaying the current config keys, a button to delete a value selected in the list box, an edit field for entering a new configuration key, and a button for adding said configuration key to the listbox table.
All works swimmingly except that the list box on the dialog screen does not refresh/repaint when a value has been added or removed. If the user cycles off the dialog (Previous / Next) and then returns to this screen after adding or removing a config key the listbox will show the current values. Per my PO, this is unacceptable (and I agree).
The only solution I've found to work is to create two identical dialog screens and toggle between them at the end of the add/remove action. This forces the repaint and from the end user's POV this process is transparent. Unfortunately, my PO doesn't find this solution acceptable either.
So, having exhausted Google and my patience with MSDN, I turn to the hive mind in the event someone else has come across this problem and solved it in a more elegant manner. If you think it might help, I can post code snippets and link to screencaps. I have a vested interest in getting this done today so I can leave at a reasonable hour.
posted by Fezboy! to computers & internet (8 comments total)
posted by orthogonality at 12:30 PM on November 21, 2008