Click here to Skip to main content
15,920,801 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How do I change cursors? Pin
Renjith Ramachandran16-Sep-02 8:23
Renjith Ramachandran16-Sep-02 8:23 
GeneralRe: How do I change cursors? Pin
Nitron16-Sep-02 8:40
Nitron16-Sep-02 8:40 
GeneralRe: How do I change cursors? Pin
Chris Losinger16-Sep-02 8:51
professionalChris Losinger16-Sep-02 8:51 
AnswerRe: How do I change cursors? Pin
Michael Dunn16-Sep-02 11:16
sitebuilderMichael Dunn16-Sep-02 11:16 
Generalprint pdf without Acrobat. Pin
pnpfriend16-Sep-02 7:32
pnpfriend16-Sep-02 7:32 
GeneralRe: print pdf without Acrobat. Pin
l a u r e n16-Sep-02 10:46
l a u r e n16-Sep-02 10:46 
GeneralRe: print pdf without Acrobat. Pin
Anonymous16-Sep-02 13:39
Anonymous16-Sep-02 13:39 
GeneralPlacing Icons on a CStatic-derived class Pin
MightyThor16-Sep-02 7:23
MightyThor16-Sep-02 7:23 
Hi,

I have a class derived from CStatic. When cursor is over the control i want the text to change color. To manage this i had override OnPaint. It works fine but the problem is i also want this control to be capable of displaying icons.

I tried the following code but it didn't work:

if( m_hIcon )
{
CStatic::SetIcon( m_hIcon ); (Line 1)
}
else
{
// If no icon is specified just draw the text
dc.DrawText( str, str.GetLength(), rect,
DT_CENTER | DT_VCENTER | DT_SINGLELINE );
}

m_hIcon, is spcified by user by the overriden SetIcon method:

HICON CTableTextStatic::SetIcon(HICON hIcon)
{
m_hIcon = hIcon;
return m_hIcon;
}

Can you tell me what am i doing wrong here?

I also tried replacing "Line 1" above with the below:

dc.DrawIcon( rect.Width() / 2, 0, m_hIcon );

It works but i want the icon to be centered and i couldn't find a way to get icon's size.
And with this way, it draws the icon even if SS_ICON style is not specified. Does that mean using DrawIcon is not a nice way to do it?


Sorry for the long post. It would be great if you could help me on this one.

Thank you in advance.


GeneralRe: Placing Icons on a CStatic-derived class Pin
Joaquín M López Muñoz16-Sep-02 9:27
Joaquín M López Muñoz16-Sep-02 9:27 
GeneralRe: Placing Icons on a CStatic-derived class Pin
MightyThor16-Sep-02 10:10
MightyThor16-Sep-02 10:10 
GeneralRe: Placing Icons on a CStatic-derived class Pin
MightyThor17-Sep-02 7:00
MightyThor17-Sep-02 7:00 
QuestionHow to use webdings on a button Pin
Max Santos16-Sep-02 6:55
Max Santos16-Sep-02 6:55 
Generalwindows messages Pin
Zizilamoroso16-Sep-02 6:28
Zizilamoroso16-Sep-02 6:28 
GeneralRe: windows messages Pin
Mike Nordell16-Sep-02 6:33
Mike Nordell16-Sep-02 6:33 
GeneralRe: windows messages Pin
Zizilamoroso16-Sep-02 6:45
Zizilamoroso16-Sep-02 6:45 
GeneralRe: windows messages Pin
Pavel Klocek16-Sep-02 8:14
Pavel Klocek16-Sep-02 8:14 
GeneralProblem with "User breakpoint" and RtlFreeHeap. All help appreciated. Pin
16-Sep-02 6:20
suss16-Sep-02 6:20 
Generalpositioning problems Pin
ns16-Sep-02 5:41
ns16-Sep-02 5:41 
GeneralRe: positioning problems Pin
Bill Wilson16-Sep-02 5:51
Bill Wilson16-Sep-02 5:51 
GeneralRe: positioning problems Pin
Max Santos16-Sep-02 6:14
Max Santos16-Sep-02 6:14 
QuestionReuse CFormview derived class as dialog? Pin
Aaron Schaefer16-Sep-02 5:23
Aaron Schaefer16-Sep-02 5:23 
AnswerRe: Reuse CFormview derived class as dialog? Pin
Pavel Klocek16-Sep-02 8:24
Pavel Klocek16-Sep-02 8:24 
GeneralSingle computer identification Pin
doctorpi16-Sep-02 5:14
doctorpi16-Sep-02 5:14 
GeneralRe: Single computer identification Pin
Max Santos16-Sep-02 6:52
Max Santos16-Sep-02 6:52 
GeneralRe: Single computer identification Pin
Renjith Ramachandran16-Sep-02 7:47
Renjith Ramachandran16-Sep-02 7:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.