Custom color dialog...

P

Peder Y

I'm trying to make a custom color dialog. At this point I've designed it
as about 200 buttons on a form with different background colors. This
works, but is somewhat slow. Now, the effect I'm trying to produce is
the same as is used in most major text editing and drawing applications.
If the user shifts focus to anything else in the application, the dialog
should disappear. Hence ShowDialog won't work. I use a LostFocus
listener to close the dialog and form.Show(), but this disables the
application from "waiting" at the Show() call so the main application
can collect the return color value once the color dialog closes. Hence,
I want the ShowDialog-style halting of the caller process plus the
possibility of externaly closing the dialog and thus make the caller
process continue. Can this be done elegantly? Anyone knows the common
way of doing this?

Example:

MyColorDialog frm = new MyColorDialog();
frm.Show();
// Wait politely for either color chosen or lost focus...
someButton.BackColor = frm.ReturnColor;


Thanks!
 
K

Ken Tucker [MVP]

Hi,


Maybe this will help.

http://msdn.microsoft.com/msdnmag/issues/03/07/GDIColorPicker/

Ken
----------------------
I'm trying to make a custom color dialog. At this point I've designed it
as about 200 buttons on a form with different background colors. This
works, but is somewhat slow. Now, the effect I'm trying to produce is
the same as is used in most major text editing and drawing applications.
If the user shifts focus to anything else in the application, the dialog
should disappear. Hence ShowDialog won't work. I use a LostFocus
listener to close the dialog and form.Show(), but this disables the
application from "waiting" at the Show() call so the main application
can collect the return color value once the color dialog closes. Hence,
I want the ShowDialog-style halting of the caller process plus the
possibility of externaly closing the dialog and thus make the caller
process continue. Can this be done elegantly? Anyone knows the common
way of doing this?

Example:

MyColorDialog frm = new MyColorDialog();
frm.Show();
// Wait politely for either color chosen or lost focus...
someButton.BackColor = frm.ReturnColor;


Thanks!
 
S

Sergey Novogilov

Probably standard (Windows common) Color dialog in modeless mode can help?
In this case try Dialog Workshop .NET.
It contains advanced ColorDialog component which can be dispalyed as
modeless window.
Please visit http://www.componentage.com for details.


Sergey
 
S

Sergey Novogilov

Probably standard (Windows common) Color dialog in modeless mode can help?
In this case try Dialog Workshop .NET.
It contains advanced ColorDialog component which can be dispalyed as
modeless window.
Please visit http://www.componentage.com for details.


Sergey
 
S

Sergey Novogilov

Probably standard (Windows common) Color dialog in modeless mode can help?
In this case try Dialog Workshop .NET.
It contains advanced ColorDialog component which can be dispalyed as
modeless window.
Please visit http://www.componentage.com for details.


Sergey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top