Results 1 to 14 of 14

Thread: Color ComboBox

Threaded View

  1. #9
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width