|
|
#1 |
|
Junior Member
Join Date: Apr 2012
Posts: 10
|
SetCtlColors ${NSD_OnChange} Bug?
In my Installer I use my own validation.
For the validation of Textfields I use the ${NSD_OnChange} to link to the validation function. The validation-function then uses SetCtlColors to set the background of the textfield red. The validation itself works fine(it also disables the Next button, which works perfect and without delay), unfortunately the Backgroundcolor change doesn't. When I input a "wrong" value the Background first doesn't change at all and then(when i move the cursor or type in another character) changes weirdly like so: (http://imageshack.us/photo/my-images/707/bughfd.png/)only when i move the cursor the background changes properly to red. How do I fix this Problem? Is it a bug? |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Try forcing a redraw of the control. You can do this by calling InvalidateRect with the System plug-in or simply hide and show the control using ShowWindow.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,775
|
You need to call InvalidateRect or hide+show the window... (I'm pretty sure there is already a thread about this)
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2012
Posts: 10
|
Thanks for you reply,
I tried the ShowWindow method but I get the same result, this is the code I used: SetCtlColors $hwndIP1 "" FF3333 ShowWindow $hwndIP1 ${SW_HIDE} ShowWindow $hwndIP1 ${SW_SHOW} and also tried to hide the control before I change the colour. Edit: I didnt find a thread about the problem I have, I was looking for quite a while. Ill try the invalidateRect method and report back |
|
|
|
|
|
#5 | |
|
Forum King
|
Quote:
|
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2012
Posts: 10
|
Thanks a lot, LockWindow in combination with ShowWindow works, although it flicker when i validate.
Edit: Sorry, it does work better but I sometimes still have the same Problem (I used LockWindow off above the SetClColors) |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2012
Posts: 10
|
Sorry for the doublepost;
After trying out pretty much everything i found on the forums, i found out that the least amout of code that does the trick(without flickering) is: SetCtlColors $hwndTextfield "" FF3333 System::Call "user32::InvalidateRect(i,i,i)i ($hwndTextfield, 0, 1)" |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,775
|
I'm not really sure why SetCtlColors does not call InvalidateRect, you could add a feature request (or bug report?) for it if you want...
IntOp $PostCount $PostCount + 1 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|