|
thanks form reply
but sir i use this one but it does not change the color
HBRUSH CButtoncolorDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_BTN)
{
hbr=CreateSolidBrush(RGB(0,100,0));
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(RGB(0,100,0));
}
return hbr;
}
Ashish Dogra
MCA
Noida
|
|
|
|
|
Did you set the BS_OWNERDRAW property of the button's to TRUE.
I guess not.Do it and then you will see the button color change.
To change the property of the button to owner draw right click on the button . Open the property window and just set the OWNER Draw property to true.
IS it OK?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
THANKS
Ashish Dogra
MCA
Noida
|
|
|
|
|
hi again
i am sorry to disturb you again
but i make an application in which many dialog boxes are there
now when i make ownerdraw property true the application does not run and if i make ownerdraw property false the application runs
i dont understand the problem
so plz tell me what is the problem
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
whats error you get one error when you set Ownerdraw,right?
whitesky
|
|
|
|
|
application does not run it simply show an message that application has encountreda problem and need to close
Ashish Dogra
MCA
Noida
|
|
|
|
|
see my example i hope you find why when you use ownerdraw you get error.
in MSDN you see:
"BS_OWNERDRAW
Creates an owner-drawn button. The owner window receives a WM_DRAWITEM message when a visual aspect of the button has changed. Do not combine the BS_OWNERDRAW style with any other button styles."
whitesky
|
|
|
|
|
HBRUSH CButtoncolorDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_BTN)
{
if( pWnd == "Your specific button pointer" )
return CreateSolidBrush(RGB(0,100,0));
}
return hbr;
}
I wonder maybe you need to use new font ( by SelectObject() ) to change the font color.
|
|
|
|
|
You can use a class derived CButton and use WM_DRAWITEM of course you need to set OwnerDraw in
property button in property window
whitesky
|
|
|
|
|
I think you need to one code so see this you need to insert this code in your project for one start
m_Button.ModifyStyle(0,BS_OWNERDRAW);
m_Button is CMyButton1
class CMyButton1 : public CButton
{
DECLARE_DYNAMIC(CMyButton1)
public:
CMyButton1();
virtual ~CMyButton1();
protected:
DECLARE_MESSAGE_MAP()
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
};
IMPLEMENT_DYNAMIC(CMyButton1, CButton)
CMyButton1::CMyButton1()
{
}
CMyButton1::~CMyButton1()
{
}
BEGIN_MESSAGE_MAP(CMyButton1, CButton)
END_MESSAGE_MAP()
void CMyButton1::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
CRect rt;
rt = lpDrawItemStruct->rcItem;
dc.SetBkMode(0);
CString str;
GetWindowText(str);
if ( (lpDrawItemStruct->itemState & ODS_SELECTED) )
{
dc.FrameRect(&rt,&CBrush(RGB(110,170,210)));
dc.SetTextColor(RGB(0,0,0));
dc.FillRect(&rt,&CBrush(RGB(190,210,210)));
}
else
{
dc.FrameRect(&rt,&CBrush(RGB(0,0,0)));
dc.SetTextColor(RGB(255,255,255));
dc.FillRect(&rt,&CBrush(RGB(100,170,210)));
}
dc.DrawText(str,rt,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
dc.Detach();
}
</code>
whitesky
|
|
|
|
|
Hi I want to make an imap client using c++ can anyone guide me which way to follow.
Thanks,
answer_me
|
|
|
|
|
I don't kwon if it help you, but here's PJ Naughter's MAPI Implementation[^] Good luck and keep the good coding!
|
|
|
|
|
Hi!
I tried to build a sample and then I got this error:
LINK : fatal error LNK1104: cannot open file "atls.lib"
I linked all the libraries I need. I can't find this atls.lib anywhere, on my computer or the Internet. I tried to make visual c++ to ignore this lib too, but nothing works.
But through some sources i came to know that, it comes along with Microsoft Visual Studio.NET 2003 (VC7).So i installed Microsoft Visual Studio.NET 2003 (VC7)in my machine.
After that i built the application, but got the following errors:
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol ___security_cookie
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol __SEH_epilog
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol __SEH_prolog
Can any one help me please ??
|
|
|
|
|
dashprasannajit wrote: I can't find this atls.lib anywhere, on my computer or the Internet.
Google: MSDN atls.lib
92 hits
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Maybe you're using a newer version of the Internet.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
can anyone show me how to connect to a database using CDatabase class. I'd prefer if you'll use access for simplicity.
Thanks...
---------------------Life is simple, You just complicate things------------------
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
See here for an example.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i use CreateService to create a driver service
then CreateService return NULL
i use GetLastError() then return 4 (System cannot open file)
i can create service on 2000 system,but in xp system i can not
what make this error
who can help me?
hi
|
|
|
|
|
zt9788 wrote: i use GetLastError() then return 4 (System cannot open file)
Are you sure it's not ERROR_TOO_MANY_OPEN_FILES ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am writing a fairly simple Windows application that I plan to distribute as freeware. For that reason, I want the application to execute on Windows 95, 98, 2000, and Xp without having to create separate versions. I recently started learning C# on .net 2.0. Can I use C# to write a WinForm application to run on Windows 95, 98, 2000, and XP? I understand that the .net framework is required to run a Windows application that makes use of any DLL in .net, but if the user does not have .net installed, is it possible to package the necessary .net DLL with the application installer?
Thanks!
Raffi
|
|
|
|
|
|
Hi Jun,
I know about the redistributable, but is it possible to reduce the size of the file to include only those DLL's required by the application? The redistributable is 20MB!
Thanks for the info!
Raffi
|
|
|
|