|
-
Jul 29th, 2009, 03:42 PM
#9
Re: Color ComboBox
I get the Invalid Parameter exception too, on XP Media Center Edition 2005.
The Invalid Parameter exception occurs when you dispose a brush that is set to any of the default brushes in the Brushes enumeration, exactly what you are doing.
I'm not sure why that fails, but I suppose you can't Dispose a brush you are not specifically creating a new instance of..?
I don't understand why it fails every single time here, but works fine with you? Maybe a recent update 'fixed' / 'destroyed' (I'm not sure which of the two ) this, seeing as this thread is half a year old? 
The fix is just to not dispose your brush.
By the way, great control, looks very similar to the Visual Studio one.
In my opinion, a Designer class with Smart Tags would work wonders on this control... You could set the color more easily during design-time that way, as well as quickly including or excluding system colors / transparent with a checkbox.
If you want to implement the Smart Tags, do a search for them in the codebank, I made a 'tutorial' about them a while ago.
EDIT
Actually, I was smart(-Tag) enough to include a dash in my topic title, so searching for 'Smart Tags' does not bring it up 
Here it is:
http://www.vbforums.com/showthread.php?t=552296
Last edited by NickThissen; Jul 29th, 2009 at 03:51 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|