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. Adding static control to childvew

Adding static control to childvew

Scheduled Pinned Locked Moved C / C++ / MFC
help
7 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.
  • R Offline
    R Offline
    rajeev82
    wrote on last edited by
    #1

    Hi all, Instead of opening a Static control(which is subclassed) in a Dialog box,i want to open it in the Mainframe window. But when i create a variable of the class(subclassed) in the MainFrame(derived from CFrameWnd)and call the Create(with all right parameters) function the control is not visible in the Mainframe window :(( i'm not able to figure out the reason :zzz: y itz not showing up.It'll be really great if someone can help me out in this. Thanks in advance, rajeev

    V 1 Reply Last reply
    0
    • R rajeev82

      Hi all, Instead of opening a Static control(which is subclassed) in a Dialog box,i want to open it in the Mainframe window. But when i create a variable of the class(subclassed) in the MainFrame(derived from CFrameWnd)and call the Create(with all right parameters) function the control is not visible in the Mainframe window :(( i'm not able to figure out the reason :zzz: y itz not showing up.It'll be really great if someone can help me out in this. Thanks in advance, rajeev

      V Offline
      V Offline
      Viorel
      wrote on last edited by
      #2

      When you create the control with Create, be sure the WS_VISIBLE window style is specified, for instance:

      myStatic.Create("Test", WS_BORDER | WS_VISIBLE, CRect(30,30,100,100), this, 12345);
      
      R 1 Reply Last reply
      0
      • V Viorel

        When you create the control with Create, be sure the WS_VISIBLE window style is specified, for instance:

        myStatic.Create("Test", WS_BORDER | WS_VISIBLE, CRect(30,30,100,100), this, 12345);
        
        R Offline
        R Offline
        rajeev82
        wrote on last edited by
        #3

        well all those properties have been set properly but still i'm not able to get it right.. -- modified at 9:55 Friday 9th June, 2006

        V C 2 Replies Last reply
        0
        • R rajeev82

          well all those properties have been set properly but still i'm not able to get it right.. -- modified at 9:55 Friday 9th June, 2006

          V Offline
          V Offline
          Viorel
          wrote on last edited by
          #4

          Is your variable for static control defined as a class member, or as a local variable in CMainFrame::OnCreate? In order to work, you have to have a line like CMyStatic mMyStatic; within frame class declaration (in *.h file), and a line like mMyStatic.Create(...) somewhere at the end of CMainFrame::OnCreate function. Where are you creating the control?

          1 Reply Last reply
          0
          • R rajeev82

            well all those properties have been set properly but still i'm not able to get it right.. -- modified at 9:55 Friday 9th June, 2006

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            What type of project are you using ? SDI or MDI ? If it's SDI, I think you have to create it on the view, and not on the mainframe.


            Cédric Moonen Software developer
            Charting control

            R 1 Reply Last reply
            0
            • C Cedric Moonen

              What type of project are you using ? SDI or MDI ? If it's SDI, I think you have to create it on the view, and not on the mainframe.


              Cédric Moonen Software developer
              Charting control

              R Offline
              R Offline
              rajeev82
              wrote on last edited by
              #6

              its an SDI application.... the code i've used is CLed m_led; ///declared in mainframe.h m_led.Create(...);// in the OnCretae of mainframe.cpp here CLed is a class derived from CStatic which gives some special features to a static control...

              C 1 Reply Last reply
              0
              • R rajeev82

                its an SDI application.... the code i've used is CLed m_led; ///declared in mainframe.h m_led.Create(...);// in the OnCretae of mainframe.cpp here CLed is a class derived from CStatic which gives some special features to a static control...

                C Offline
                C Offline
                Cedric Moonen
                wrote on last edited by
                #7

                Did you read and tried the solution that people gave you ? I'm almost sure that Viorel got the point. Did you tried it ?


                Cédric Moonen Software developer
                Charting control

                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