








nanomachine007 wrote:dlg.GetColor();
that's line get return color structure, check help online about CColorDialog and you will find your answer.
that's code i put it in a button click
--------------------Configuration: color1 - Win32 Debug--------------------
Compiling...
color1Dlg.cpp
C:\color\color1\color1Dlg.cpp(205) : error C2065: 'm_edit' : undeclared identifier
C:\color\color1\color1Dlg.cpp(205) : error C2228: left of '.SetBackColor' must have class/struct/union type
Error executing cl.exe.
color1.exe - 2 error(s), 0 warning(s)


nanomachine007 wrote:man the m_edit is a instance of my class derived from CEdit. I have created a CCustomEdit derived from CEdit blablablabal and my m_edit is an instance of CCustomeEdit blablabla.
I just show u how to make popup color dialog.
you dont need m_edit and i think loco forum is not really for mfc lol
CColorDialog dlg;
if (dlg.DoModal() == IDOK)
yourcolorpickuphere=dlg.GetColor();
I cannot give u step by step i just can give u a hint or tips man. it's too long step by step.



nanomachine007 wrote:// Get the selected color from the CColorDialog.
CColorDialog dlg;
if (dlg.DoModal() == IDOK)
{
COLORREF color = dlg.GetColor();
}
try that code in a button click dude, and i think u must go to codeproject.com to learn mfc
--------------------Configuration: color1 - Win32 Debug--------------------
Compiling...
color1Dlg.cpp
C:\color\color1\color1Dlg.cpp(247) : error C2065: 'color' : undeclared identifier
Generating Code...
Compiling...
color1.cpp
Generating Code...
Error executing cl.exe.
color1.exe - 1 error(s), 0 warning(s)



Return to C++, C# And Others Programming
Users browsing this forum: No registered users and 0 guests