|
gnanapaul wrote: How to change backgroungcolor and text color of CButton
You have to owner draw the button to change the back ground color and text color
gnanapaul wrote: ?(do not using seperate class)
Handle the WM_DRAWITEM [^]message in the dialog and do the painting if the control id matches.
|
|
|
|
|
can you please explain briefly?
G.Paulraj
|
|
|
|
|
gnanapaul wrote: can you please explain briefly?
Yes, see [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
gnanapaul wrote: can you please explain briefly?
I means as follows
void CMyDialog::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if( nIDCtl == m_Button.GetDlgCtrlID()) {
return;
}
CMyDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
}
|
|
|
|
|
Or handle the WM_CTLCOLORBTN message in the parent.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Code-o-mat wrote: Or handle the WM_CTLCOLORBTN message in the parent.
I dont think this message help in changing the color of button. Did you try?
|
|
|
|
|
Yes, you are right, sorry, i forgot it doesn't work for buttons, which is imho a bit lame... and even if it worked, if it comes to XP style skinned, rounded, fancy buttons you can forget about it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Have a look at WM_CTLCOLOR / CWnd::OnCltColor.
This lets a a dialog control change the brush of a child button (etc).
It gives the the DC that the control will draw into - so you can (I'm fairly sure) also use pDC->SetTextColor at the same time.
Iain.
|
|
|
|
|
Iain Clarke wrote: It gives the the DC that the control will draw into
I dont think so[^]
|
|
|
|
|
You can use of WM_CTLCOLORBTN .See here[^]
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
|
Hi all,
Does ATLASSERT run during release mode? should I enclose it with ifdef debug? Or it doesnt do anything on release mode?
Thanks,
Jayjay
|
|
|
|
|
What about reading documentation [^], [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The regular answer would be "RTFM".
Greetings from Germany
|
|
|
|
|
Hi programmers!
I have a question on how to attach another window. Here is a little explanation.
I created a Frame in wxWidgets and made it transparent. Now i want to attach it to another window or even better over another Window (WinAPI). I tried SetParent(child,parent) and set my window as a child window of the parent. The problem is that if the parent window updates the view, my window is in a new order and antoher window is over it and mine disappears. Is it possible to set my window over the other window without using SetParent() but my window should appear if the other window appears and disappear if the other window disappears. is it possible?
Thank you very much ans please excuse my bad english
|
|
|
|
|
Dear all,
I have created an application where i want to open two dialog box, against clicking two toolbar Button. I have created object of that two dialog class and used DoModal(). Have there any option except DoModal() to open Two Dialog at same time?
Regards
Munna
Indian Statistical Institute(ISI)
|
|
|
|
|
Depends of what you want to do exactly: if you still want to let the user interact with the main user interface, then you have to use two modeless dialogs.
If you want the user only to interact with the dialogs, then you have to create a modal dialog (like you are doing now) and from this one create a modeless dialog.
Anyway, the solution is to use modeless dialogs . Search for that on codeproject or google and you'll find a lot of examples.
|
|
|
|
|
Thanks for that.
Can u told me What command will i use for mode less dialog to show. I want to give permission user to interact with the main user Interface.
|
|
|
|
|
|
Shaheen.India wrote: Have there any option except DoModal() to open Two Dialog at same time?
Yes, see for instance [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
Im having the ex.txt file in one variable.I need to save this file into some other location using file browser(browse button).
code is:
CFile f;
char strFilter[] = { "BCR Files (*.bcr)|*.bcr|All Files (*.*)|*.*||" };
CFileDialog FileDlg(FALSE, ".bcr", NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite);
CArchive ar(&f, CArchive::store);
ar.Close();
}
else
return;
f.Close();
How to automatically give this ex.txt in File name.
Pls help me....
Thanks & Regards
Anitha
|
|
|
|
|
AnithaSubramani wrote: How to automatically give this ex.txt in File name.
Like this?
CFileDialog FileDlg(FALSE, ".bcr", _T("ex.txt"), 0, strFilter);
|
|
|
|
|
I got the result.
Thanks a lot.............
|
|
|
|
|
while compiling any prgramin vc++ i am getting the same error pls tell me why it is so like this...
MSVCRTD.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
1 unresolved externals]]
Fatal error!!
these r the errors i am always gettings..
|
|
|
|
|
Try New Project > Win32 Console Application.
|
|
|
|