Click here to Skip to main content
15,925,399 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: trying to find old post about EN_CHANGE Pin
ns17-Sep-02 2:54
ns17-Sep-02 2:54 
Generalcant figure out the simple logic!!! Pin
ns16-Sep-02 8:35
ns16-Sep-02 8:35 
GeneralRe: cant figure out the simple logic!!! Pin
jmkhael16-Sep-02 8:52
jmkhael16-Sep-02 8:52 
GeneralRe: cant figure out the simple logic!!! Pin
ns16-Sep-02 9:04
ns16-Sep-02 9:04 
GeneralRe: cant figure out the simple logic!!! Pin
Joaquín M López Muñoz16-Sep-02 9:04
Joaquín M López Muñoz16-Sep-02 9:04 
GeneralRe: cant figure out the simple logic!!! Pin
Pavel Klocek16-Sep-02 8:55
Pavel Klocek16-Sep-02 8:55 
GeneralRe: cant figure out the simple logic!!! Pin
Joaquín M López Muñoz16-Sep-02 9:03
Joaquín M López Muñoz16-Sep-02 9:03 
GeneralRe: cant figure out the simple logic!!! Pin
Bill Wilson16-Sep-02 11:10
Bill Wilson16-Sep-02 11:10 
QuestionHow do I change cursors? Pin
Nitron16-Sep-02 8:10
Nitron16-Sep-02 8:10 
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 
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 
I solved my problem. In case, in the future someone faces the same problem i decided to write how i solved it:

Instead of using DrawIcon method of CDC, i used DrawIconEx.

if( m_hIcon )
{
::DrawIconEx(	dc.m_hDC, 
		( rect.Width() / 2 - m_nIconWidth / 2 ), 
		( rect.Height() / 2 - m_nIconHeight / 2), 
 	        m_hIcon,
		m_nIconWidth, 
		m_nIconHeight, 
		NULL, 
		NULL,
		DI_IMAGE );
}
else
{	
   if( str )
   {
	dc.DrawText( str, str.GetLength(), rect, DT_CENTER  
             | DT_VCENTER | DT_SINGLELINE );
   }
}


and SetIcon function

void CTableTextStatic::SetIcon(HICON hIcon, int width, int height)
{
	m_hIcon = hIcon;
	m_nIconWidth = width;
	m_nIconHeight = height;
}


This way, i can specify any size for icon and it resizes( stretches or compresses) the icon automatically. And it draws centered.
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 

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.