Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. The Lounge
  3. Changing Label Size/Font help

Changing Label Size/Font help

Scheduled Pinned Locked Moved The Lounge
helpvisual-studiocomtutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dragondima
    wrote on last edited by
    #1

    Hello, I'm having a very difficult time changing parameters using code to a program that has a few labels. I was able to move their position, change their color, but unfortunately not their sizes. This project also uses ActiveX. I'm using VS 2008, and the only articles that give any insight are all for VS 6. m_lblctrl1.SetWindowPos(&wndBottom,0,0,0,0,SWP_NOSIZE); changes m_lblctrl1 position (x,y,cx,cy) m_lblctrl1.SetForeColor(RGB(255,0,0)); changes m_lblctrl1 to red. m_lblctrl1.SetFont(LPFONTDISP); now this is where i've been hitting a very bad wall this is the method i've been tackling. LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); // zero out structure lf.lfHeight = 12; // request a 12-pixel-height font strcpy_s(lf.lfFaceName, "Arial"); // request a face name "Arial" VERIFY(font.CreateFontIndirect(&lf)); // create the font m_lblctrl1.SetFont(&lf); the error i'm getting is "error C2664: 'CLabel::SetFont' : cannot convert parameter 1 from 'LOGFONT *' to 'LPFONTDISP' " I've done all the research i could do to properly troubleshoot this, but unfortunately i've hit the point where i need professional help. m_lblctrl1 is defined as a CLabel in case that helps. Also i used Do Data Exchange from the original label defined: DDX_Control(pDX, IDC_LBLCTRL1, m_lblctrl1); If anyone has experience with this LPFONTDISP and how to change the label size/font, i'd greatly appreciate help. Thank you for any input, if there is any details i left out, I'd gladly add it. -David

    D M 2 Replies Last reply
    0
    • D Dragondima

      Hello, I'm having a very difficult time changing parameters using code to a program that has a few labels. I was able to move their position, change their color, but unfortunately not their sizes. This project also uses ActiveX. I'm using VS 2008, and the only articles that give any insight are all for VS 6. m_lblctrl1.SetWindowPos(&wndBottom,0,0,0,0,SWP_NOSIZE); changes m_lblctrl1 position (x,y,cx,cy) m_lblctrl1.SetForeColor(RGB(255,0,0)); changes m_lblctrl1 to red. m_lblctrl1.SetFont(LPFONTDISP); now this is where i've been hitting a very bad wall this is the method i've been tackling. LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); // zero out structure lf.lfHeight = 12; // request a 12-pixel-height font strcpy_s(lf.lfFaceName, "Arial"); // request a face name "Arial" VERIFY(font.CreateFontIndirect(&lf)); // create the font m_lblctrl1.SetFont(&lf); the error i'm getting is "error C2664: 'CLabel::SetFont' : cannot convert parameter 1 from 'LOGFONT *' to 'LPFONTDISP' " I've done all the research i could do to properly troubleshoot this, but unfortunately i've hit the point where i need professional help. m_lblctrl1 is defined as a CLabel in case that helps. Also i used Do Data Exchange from the original label defined: DDX_Control(pDX, IDC_LBLCTRL1, m_lblctrl1); If anyone has experience with this LPFONTDISP and how to change the label size/font, i'd greatly appreciate help. Thank you for any input, if there is any details i left out, I'd gladly add it. -David

      D Offline
      D Offline
      Dalek Dave
      wrote on last edited by
      #2

      Before tackling that rather difficult project I would advise you to learn ENGLISH. That way you will understand the words "DO NOT POST PROGRAMMING QUESTIONS IN THE LOUNGE" that you obviously were unable to comprehend.

      ------------------------------------ No Good Deed Goes Unpunished Clare Boothe Luce

      1 Reply Last reply
      0
      • D Dragondima

        Hello, I'm having a very difficult time changing parameters using code to a program that has a few labels. I was able to move their position, change their color, but unfortunately not their sizes. This project also uses ActiveX. I'm using VS 2008, and the only articles that give any insight are all for VS 6. m_lblctrl1.SetWindowPos(&wndBottom,0,0,0,0,SWP_NOSIZE); changes m_lblctrl1 position (x,y,cx,cy) m_lblctrl1.SetForeColor(RGB(255,0,0)); changes m_lblctrl1 to red. m_lblctrl1.SetFont(LPFONTDISP); now this is where i've been hitting a very bad wall this is the method i've been tackling. LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); // zero out structure lf.lfHeight = 12; // request a 12-pixel-height font strcpy_s(lf.lfFaceName, "Arial"); // request a face name "Arial" VERIFY(font.CreateFontIndirect(&lf)); // create the font m_lblctrl1.SetFont(&lf); the error i'm getting is "error C2664: 'CLabel::SetFont' : cannot convert parameter 1 from 'LOGFONT *' to 'LPFONTDISP' " I've done all the research i could do to properly troubleshoot this, but unfortunately i've hit the point where i need professional help. m_lblctrl1 is defined as a CLabel in case that helps. Also i used Do Data Exchange from the original label defined: DDX_Control(pDX, IDC_LBLCTRL1, m_lblctrl1); If anyone has experience with this LPFONTDISP and how to change the label size/font, i'd greatly appreciate help. Thank you for any input, if there is any details i left out, I'd gladly add it. -David

        M Offline
        M Offline
        moon_stick
        wrote on last edited by
        #3

        Try posting in the correct board (C++ Board[^]) - this board's for general chat rather than programming specific questions. You'll get told off otherwise!! EDIT: Just seen the message posted before mine! ;P

        It definitely isn't definatley

        D 1 Reply Last reply
        0
        • M moon_stick

          Try posting in the correct board (C++ Board[^]) - this board's for general chat rather than programming specific questions. You'll get told off otherwise!! EDIT: Just seen the message posted before mine! ;P

          It definitely isn't definatley

          D Offline
          D Offline
          Dragondima
          wrote on last edited by
          #4

          Hey, sorry i actually thought i was posting in the c++ forum, but i'm new to this site, and poorly navigated. I'm sorry i'll more aware for enxt time. -David

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups