CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    116

    [RESOLVED] How to increase font size in buttons

    How to increase font size for a specific button?

    I tried to change the nHeight but it doesn't seems to change the font size. Any idea why?

    Code:
    			  CFont font;
    
    			font.CreateFont(
    			12,                        // nHeight
    			0,                         // nWidth
    			0,                         // nEscapement
    			0,                         // nOrientation
    			FW_REGULAR,                   // nWeight
    			FALSE,                     // bItalic
    			FALSE,                     // bUnderline
    			0,                         // cStrikeOut
    			ANSI_CHARSET,              // nCharSet
    			OUT_DEFAULT_PRECIS,        // nOutPrecision
    			CLIP_DEFAULT_PRECIS,       // nClipPrecision
    			DEFAULT_QUALITY,           // nQuality
    			DEFAULT_PITCH | FF_SWISS,  // nPitchAndFamily
    			"Arial"); 
    
    			GetDlgItem( IDC_BUTTON3 )->SetFont(&font);

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: How to increase font size in buttons

    Probably because your CFont object is local to the function that sets the font.

  3. #3
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: How to increase font size in buttons

    Thank you sir .. I also tried the prog.
    I just shifted CFont font to dialog.h file . That solved the problem.

  4. #4
    Join Date
    Apr 2009
    Posts
    116

    Re: How to increase font size in buttons

    Alright, thanks got it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured