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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can i hide Static Text in MFC ?

How can i hide Static Text in MFC ?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
6 Posts 5 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.
  • S Offline
    S Offline
    sumit durg
    wrote on last edited by
    #1

    I tried following code but it working for Progess bar not for Static text. GetDlgItem(IDC_PROGRESS1)->ShowWindow(SW_SHOW); // Working GetDlgItem(IDC_STATIC)->ShowWindow(SW_SHOW); // Not working Kindly provide me solution...

    T J 2 Replies Last reply
    0
    • S sumit durg

      I tried following code but it working for Progess bar not for Static text. GetDlgItem(IDC_PROGRESS1)->ShowWindow(SW_SHOW); // Working GetDlgItem(IDC_STATIC)->ShowWindow(SW_SHOW); // Not working Kindly provide me solution...

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      IDC_STATIC as is won't work. you have to chage it to another name, like IDC_STATIC**1**...

      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      1 Reply Last reply
      0
      • S sumit durg

        I tried following code but it working for Progess bar not for Static text. GetDlgItem(IDC_PROGRESS1)->ShowWindow(SW_SHOW); // Working GetDlgItem(IDC_STATIC)->ShowWindow(SW_SHOW); // Not working Kindly provide me solution...

        J Offline
        J Offline
        Jijo Raj
        wrote on last edited by
        #3

        The IDC_STATIC is default resource id provided for controls which are usually not accessed and manipulated. For instance, static texts, GroupBox etc. If you check the value of IDC_STATIC, you can see its -1. So, if you want to manipulate that text control, as **toxcct** said, change the IDC_STATIC to some other name and access it. Or else GetDlgItem() will fail. Regards, Jijo.

        _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

        R 1 Reply Last reply
        0
        • J Jijo Raj

          The IDC_STATIC is default resource id provided for controls which are usually not accessed and manipulated. For instance, static texts, GroupBox etc. If you check the value of IDC_STATIC, you can see its -1. So, if you want to manipulate that text control, as **toxcct** said, change the IDC_STATIC to some other name and access it. Or else GetDlgItem() will fail. Regards, Jijo.

          _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

          R Offline
          R Offline
          ramnathrn
          wrote on last edited by
          #4

          can you tell me how to change the bback ground of label. Please reply me. Thanks Ram

          D J 2 Replies Last reply
          0
          • R ramnathrn

            can you tell me how to change the bback ground of label. Please reply me. Thanks Ram

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Are you referring to the background color?

            "Love people and use things, not love things and use people." - Unknown

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            • R ramnathrn

              can you tell me how to change the bback ground of label. Please reply me. Thanks Ram

              J Offline
              J Offline
              Jijo Raj
              wrote on last edited by
              #6

              ramnathrn wrote:

              can you tell me how to change the bback ground of label.

              I guess you've asked "how to change the background color of label". :) Well, override the CWnd::OnCtlColor() in your dialog class. This function will be called for getting the control color of each child control. See here for more detailed description and code sample - http://msdn.microsoft.com/en-us/library/0wwk06hc(VS.80).aspx[^] Regards, Jijo.

              _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

              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