|
you asked me and i see but you need to read six paragraph from Chris Maunder
You need to copy this code to your program and it work its not hard You can insert one button n your dialog and declare a variable for this button from type this class CMyButton not button and se BS_OWNERDRAW to true for button now you can see affect
for exmpale
<br />
(1)CMyButton m_Button;<br />
Button.ModifyStyle(0,BS_OWNERDRAW)<br />
whitesky
|
|
|
|
|
thanks sir
it works but sir the text on it is btncolor
even the text on it is click
how can i change it
and sir when i declare anoter variable of type CButton to change font it does not work
Ashish Dogra
MCA
Noida
-- modified at 6:47 Wednesday 5th July, 2006
|
|
|
|
|
What do you nedd exactly?
whitesky
|
|
|
|
|
sir i want to change the font of the text as with its color
but if i try to change the font it does not happen
Ashish Dogra
MCA
Noida
|
|
|
|
|
See
<br />
CFont m_Font;<br />
m_Font.CreateFont(...);<br />
m_YourControl.SetFont(&m_Font);<br />
whitesky
|
|
|
|
|
1)Yes we can change the style of the button. Make it owner draw etc.
2)You can derive a class from CBitmapButton and then put an image in the button
3)yes a button can be place in the title bar (we have minimize, close buttons over there)
4) yes the button of the color and its text can be changed
You can derive a class for the button from CBitmapButton and use LoadBitmap function to load the picture on the button.
You can change the text using the SetWindowText etc
I hope that I made myself clear
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
TCHAR IncompleteFilePath[MAX_PATH];;
What it mean???
|
|
|
|
|
See TCHAR is defined as follows
#ifdef UNICODE
typedef WCHAR TCHAR;
#else
typedef char TCHAR;
max path is the sum of
_MAX_DIR + _MAX_DRIVE + _MAX_EXT + _MAX_FNAME + _MAX_PATH
it means that there's is char(if ASCII) or wchar_t (if Unicode) array of size MAX_PATH
you can see these definitions, if you press F12 after selecting the requried definition (e.g TCHAR)
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
From the MSDN:
TCHAR<br />
The TCHAR data type is a Win32 character string that can be used to describe ANSI, DBCS, or Unicode strings. For ANSI and DBCS platforms, TCHAR is defined as follows:<br />
<br />
typedef char TCHAR;<br />
whitesky
|
|
|
|
|
TCHAR is a character data type definition.
If your program has a UNICODE configuration build, then it is defined as wchar_t. Otherwise it is simply defined as char
So your definition would resolve to:
<br />
char IncompleteFilePath[MAX_PATH];<br /> , for a non-Unicode app.
I Dream of Absolute Zero
|
|
|
|
|
Hello everyone,
If I am given a .lib file, how can I check whether the .lib file is a static library file (archive of obj files) or DLL implicit linking file? I have such confusion since they both use the same extension name .lib.
regards,
George
|
|
|
|
|
In my project code i hv these two instruction. please explain thease:-
1. m_CDBFile.write(reinterpret_cast<char*>(&m_Header.nNoOfRecords),sizeof(m_Header.nNoOfRecords));
2. nRetVal = MoveFileEx(lpBuffer,lpSystemDir,MOVEFILE_REPLACE_EXISTING);
THANK YOU
|
|
|
|
|
How we can add keep colors to dialog and static control
|
|
|
|
|
|
Return a different color brush from OnCtlColor for static controls
if (pWnd->GetDlgCtrlID () == IDC_STATIC)
{
return CreateSolidBrush (RGB(255,0,0));
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
can u give me small example.so that i can understand well.
ram.
|
|
|
|
|
I have already provided the example. You just need to add these lines of code in the OnCtlColor method(See My previous post) to change the color of the static controls on the dialog.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
once when i entering the text into to static .the back ground of that text is changing to my dialog color
ram
-- modified at 4:25 Wednesday 5th July, 2006
|
|
|
|
|
|
yah i done it once if i enter the text into the satic text then the back ground upto the text is changing to dialog background colour.
ram.
|
|
|
|
|
Can you show OnCtlcolor how you use this event with functions
whitesky
|
|
|
|
|
thank u for ur eply
HBRUSH CSree::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID () == IDC_STATIC1)
return CreateSolidBrush (RGB(255,255,255));
if (pWnd->GetDlgCtrlID () == IDC_STATIC2)
return CreateSolidBrush (RGB(255,0,0));
return CreateSolidBrush (RGB(0,255,255));}
|
|
|
|
|
See here after this code whats happen
<br />
HBRUSH CssDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
pDC->SetTextColor(RGB(104,144,244));
return CreateSolidBrush(RGB(53,97,244));<br />
}<br />
whitesky
|
|
|
|
|
no change .
once wew enter the text the background upto text is changed to the original color of the dialog.
|
|
|
|
|
I think (im not sure) maybe your problem isnt ctlcolor
whitesky
|
|
|
|