views:

129

answers:

2

I have an MSI dialog for validating an installation key. The dialog contains:

  • a text field (for the user to enter the key)
  • a label (to display error information, like if the key is invalid or expired)
  • a button (the "Next" button)

When the user clicks the "Next" button, the key is validated, and, if it is invalid or expired, the label is updated with text describing the error. The problem is that if the label is updated with multiple different text values (eg. the user enters an invalid key followed by an expired key), the label doesn't repaint itself correctly; it looks like the new text is printed over top of the old text. Is there a way to force the dialog (or just the label) to repaint itself correctly?

A: 

No idea, but we popup a separate error dialog displaying the issue rather than updating an existing label. On-the-fly dialog updates were just causing too many headaches, definitely could have been repainting issues now that I think about it.

sascha
+1  A: 

I was able to solve this by hiding the control and re-showing it. I added conditions to hide the control if the text was empty and show it if it was not empty. Before I validate a key, I set the text to empty, then, if the key didn't validate, I set the text to be the appropriate text.

CodeSavvyGeek

related questions