|
"To change the color of a button, you can derive a class from the button class, and draw the background yourself. No bitmap needed."
Can you explain furthur please?
|
|
|
|
|
acerunner316 wrote: Is there a simple way to change the BG color (and maybe text color also) of an editbox?
Check out the WM_CTLCOLOREDIT message.
|
|
|
|
|
This doesn't work when you've also changed the background color of the dialog box itself.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: This doesn't work when you've also changed the background color of the dialog box itself.
ummm. no Maybe you are thinking of WM_ERASEBKND?
Try it.
I posted an MFC example below.
|
|
|
|
|
Here's a Christmas edit box (adjust colors for your region/season/religion/etc):
(This is MFC code but API calls are similar)
CBrush RedBrush;
...
RedBrush.CreateSolidBrush(RGB(0xFF,0x00,0x00));
...
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (nCtlColor == CTLCOLOR_EDIT)
{
pDC->SetTextColor(RGB(0x00,0xFF,0x00));
pDC->SetBkColor(RGB(0xFF,0x00,0x00));
hbr = RedBrush;
}
return hbr;
}
-- modified at 11:25 Tuesday 5th December, 2006
|
|
|
|
|
Mark Salsbery wrote:
Christmas edit box
he he he
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
No no no...
That's "Ho Ho Ho"
|
|
|
|
|
No way
" Nothing is easy , u have to work hard "
Vikas Amin
EATON
PUNE
|
|
|
|
|
|
Hi All,
I need to write some application that send some file ( it can be word document or some exe file ) to some other machine that have with him TCP connection.
The TCP connection is not my problem - my problem\question is - how to read the file and send it to other side ? I know that i need to send the file as byte order - but i don't know how to do it.
Thanks for any help.
|
|
|
|
|
just opent the file in binary mode (e.g. fopen("foo.exe", "rb") ), read from (e.g. using fread ) and the send it through the socket.
Where is it the trouble?
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.
|
|
|
|
|
With Windows Sockets there's the TransmitFile() API (NT 3.51+).
You can also open the file, read a chunk of bytes into a buffer, send the buffer.
On the reveiving side create a file, receive a chunk of bytes into a buffer, write the bytes to
the file.
There are no byte order issues.
Mark
|
|
|
|
|
Yanshof wrote:
he TCP connection is not my problem - my problem\question is - how to read the file and send it to other side ? I know that i need to send the file as byte order - but i don't know how to do it.
open file in binary mode and send chunk by chunk.. remember Sliding Window Protocol!
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
how do i drag(move) dialog that doesn't hav title bar?
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
BlitzPackage wrote: ...and assign the necessary variables for the control, but it absolutely refuses to let me do so. I know there is some simple step that I'm forgetting.
Like using ClassWizard (Ctrl+W)? Of course, you can always do it manually.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Talking to yourself again?
|
|
|
|
|
Mark Salsbery wrote: Talking to yourself again?
No, BlitzPackage apparently deleted his post, thus orphaning mine.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Maybe he gets his answer then delete his question
|
|
|
|
|
Very stealthy.
The masked inquisitor strikes again!
|
|
|
|
|
Hi,
I can get the ActiveX ID from Client by using GetCtrlID, but I need to get the ID from ActiveX itself by calling GetCtrlId in ActiveX itself.
(in the same way as we get for a Dialog using dialogobj.GetCtrlID)
If I use it in ActiveX iam getting it as Zero in Client.
Thanks in Advance
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi, All
In one function of my project I need a 2-D vector array consisting of elements of struct STRU_A.
struct STRU_A{
char ch[20];
float score;
};
However, the two dimensions both dynamic. That is, the dimension sizes depend on the input to the function.
How to declare and use a 2-D vector array of such kind.
thank you
|
|
|
|
|
Use a double std::vector.
typedef std::vector< std::vector< STRU_A> > T2DArray;
The typedef is usefull so that you can easily declare a new instance without typing everything:
T2DArray MyArray;
|
|
|
|
|