المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Get PropertyGrid to update?



C# Programming
06-21-2009, 09:02 AM
I'm using the propertygrid control to display a small class (the class represents program settings) which contains a System.Drawing.Color, and some other properties.

When you click the dropdown next to the color and click a color... everything works fine.

The problem is if the user uses the Up and Down keyboard keys to change the color. When they do this the little color preview square next to the name of the color does not update until the Enter key is pressed.

I tried just using SendKeys to send Enter when the PropertyValueChanged event fires but unfortunately the control looses focus of the selected property.. which is exactly what happens when the enter key is pressed normally. But it's unnatural because your pressing the down and up keys to scroll through the colors... so ya Enter-key-sending is not the way to go.


Is their anyway to force that little color preview box to change to match the color name next to it http://www.barakasoft.com/script/Forums/Images/smiley_biggrin.gif