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. add title

add title

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

    HIHI, I want to ask how to add a title in child window. Thx!!!:-D

    O T 2 Replies Last reply
    0
    • W wong1907

      HIHI, I want to ask how to add a title in child window. Thx!!!:-D

      O Offline
      O Offline
      Olli
      wrote on last edited by
      #2

      Hi just implement it in your app's view-class. Just add a line in the OnInitialUpdate: CMyView::OnInitialUpdate() { SetWindowText("This is my child window title!"); CBaseClassView::OnInitialUpdate(); } Hope this helps!

      Olli I feel like I'm diagonally parked in a parallel universe.....
      :suss: :rolleyes: :suss:

      W 1 Reply Last reply
      0
      • O Olli

        Hi just implement it in your app's view-class. Just add a line in the OnInitialUpdate: CMyView::OnInitialUpdate() { SetWindowText("This is my child window title!"); CBaseClassView::OnInitialUpdate(); } Hope this helps!

        Olli I feel like I'm diagonally parked in a parallel universe.....
        :suss: :rolleyes: :suss:

        W Offline
        W Offline
        wong1907
        wrote on last edited by
        #3

        I have try this method, but this doesn't work!!!thanks you for your help :mad::((:)

        1 Reply Last reply
        0
        • W wong1907

          HIHI, I want to ask how to add a title in child window. Thx!!!:-D

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          What kind of child window it is? Tomasz Sowinski -- http://www.shooltz.com

          Never argue with an idiot, he'll bring you to his level and beat you with experience.

          W 1 Reply Last reply
          0
          • T Tomasz Sowinski

            What kind of child window it is? Tomasz Sowinski -- http://www.shooltz.com

            Never argue with an idiot, he'll bring you to his level and beat you with experience.

            W Offline
            W Offline
            wong1907
            wrote on last edited by
            #5

            It is CView window, THX!!!:-D

            T 1 Reply Last reply
            0
            • W wong1907

              It is CView window, THX!!!:-D

              T Offline
              T Offline
              Tomasz Sowinski
              wrote on last edited by
              #6

              You could try with GetParentFrame()->SetWindowText(...), but your title will be changed by MFC. To get this right, you need to override the following CMDIChildWnd method:

              void OnUpdateFrameTitle(BOOL bAddToTitle);

              In your implementation, call 'GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);' first, then set the caption with a call to AfxSetWindowText (reduces flicker). Tomasz Sowinski -- http://www.shooltz.com

              "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

              W 1 Reply Last reply
              0
              • T Tomasz Sowinski

                You could try with GetParentFrame()->SetWindowText(...), but your title will be changed by MFC. To get this right, you need to override the following CMDIChildWnd method:

                void OnUpdateFrameTitle(BOOL bAddToTitle);

                In your implementation, call 'GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);' first, then set the caption with a call to AfxSetWindowText (reduces flicker). Tomasz Sowinski -- http://www.shooltz.com

                "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

                W Offline
                W Offline
                wong1907
                wrote on last edited by
                #7

                Sorry, I am not very understand, could you mind further explain on it? Thx:-D

                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