Sign in to follow this  
gabzuka

Making A Color Box (MFC)

Recommended Posts

Hi people, I'm new to these forums and was wondering if you could help me out with a problem. I am making a sort of MSPaint program in Visual C++ using MFC, the problem is that I'm trying to make the colour box (the toolbar with the different available colours on it at the bottom of the screen in MSPaint), I made a CDialogBox and used static text with changed backgrounds to make the small squares which represent the different available colours. The problem is that I want that when I click on any of the colours, the colour I'm using to paint changes to the selected one ... the thing is that the colour selected is in my View class and this is a CDialogBox, how do I tell my View class the new colour. I hope you guys can help me out since I've looked everywhere and found nothing ... Thanks in advance, G

Share this post


Link to post
Share on other sites
Not really answering your question, but you know you can use the common colour picker dialog (Exactly the same one as the MS Paint one)?

Look into ChooseColor if you're interested.

Share this post


Link to post
Share on other sites
Well the idea is that I have 16 colours in this DialogBox and when I double-click on one of them I can change the colour with a colour picker dialog. But the problem is how to tell the other class the new colour (or how can the other classes see a variable inside my ColorDialogBox) ...

Thanks any way
G

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this