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. C, Win32 API: painting on a tabcontrol [Solved]

C, Win32 API: painting on a tabcontrol [Solved]

Scheduled Pinned Locked Moved C / C++ / MFC
json
10 Posts 3 Posters 1 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.
  • U Offline
    U Offline
    User 12105981
    wrote on last edited by
    #1

    l want to ask how l can do the following things in a tab control.

    1)That is, for instance: In tab1, when a button is clicked, previous text is wiped and another is written. l had tried but all the texts overlaps and none cleanses off for new texts.

    2)How can l erase the content of a tab control when l switch tabs. As in, when tab2 is clicked, contents in tab1 clears off and the things in tab2 only shows.

    Thanks.

    L G U 3 Replies Last reply
    0
    • U User 12105981

      l want to ask how l can do the following things in a tab control.

      1)That is, for instance: In tab1, when a button is clicked, previous text is wiped and another is written. l had tried but all the texts overlaps and none cleanses off for new texts.

      2)How can l erase the content of a tab control when l switch tabs. As in, when tab2 is clicked, contents in tab1 clears off and the things in tab2 only shows.

      Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      1. That means you are doing something wrong. Clearing the text of a windows control is quite straightforward. 2. Do you mean that you want to delete the entire tab, or just erase any text?

      U 1 Reply Last reply
      0
      • U User 12105981

        l want to ask how l can do the following things in a tab control.

        1)That is, for instance: In tab1, when a button is clicked, previous text is wiped and another is written. l had tried but all the texts overlaps and none cleanses off for new texts.

        2)How can l erase the content of a tab control when l switch tabs. As in, when tab2 is clicked, contents in tab1 clears off and the things in tab2 only shows.

        Thanks.

        G Offline
        G Offline
        Graham Breach
        wrote on last edited by
        #3

        When you get the TCN_SELCHANGE notification (in a WM_NOTIFY message) you have to clear or hide the contents of the old tab and show the contents of the new tab yourself - the API doesn't help you with it.

        U 1 Reply Last reply
        0
        • L Lost User

          1. That means you are doing something wrong. Clearing the text of a windows control is quite straightforward. 2. Do you mean that you want to delete the entire tab, or just erase any text?

          U Offline
          U Offline
          User 12105981
          wrote on last edited by
          #4

          Yes, how l can erase the content(text) in a tab control. Like, when next button is clicked, text content on the display area of the tab clears and another text is displayed. Or moreso, when Next button is clicked, another question shows and so on. Thanks.

          L 1 Reply Last reply
          0
          • U User 12105981

            Yes, how l can erase the content(text) in a tab control. Like, when next button is clicked, text content on the display area of the tab clears and another text is displayed. Or moreso, when Next button is clicked, another question shows and so on. Thanks.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            It is impossible to say, since you have not given us any information about what tab control methods you are using, what controls you have on the tab, etc.

            U 1 Reply Last reply
            0
            • L Lost User

              It is impossible to say, since you have not given us any information about what tab control methods you are using, what controls you have on the tab, etc.

              U Offline
              U Offline
              User 12105981
              wrote on last edited by
              #6

              Screen Shot is at Imgur: The most awesome images on the Internet[^]. It is ownerfixedraw style tab. so l want when Next button is clicked, question 2 will show. But as it is, when next button is clicked, both subsequent questions overlap with the current (Question 1) text. However, the next button is independent, that is, the HWND is not based on the tab control HWND. Thanks.

              L 1 Reply Last reply
              0
              • U User 12105981

                Screen Shot is at Imgur: The most awesome images on the Internet[^]. It is ownerfixedraw style tab. so l want when Next button is clicked, question 2 will show. But as it is, when next button is clicked, both subsequent questions overlap with the current (Question 1) text. However, the next button is independent, that is, the HWND is not based on the tab control HWND. Thanks.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Then you must be doing something wrong. But, as I said earlier, without more detailed information it is impossible to guess what.

                1 Reply Last reply
                0
                • G Graham Breach

                  When you get the TCN_SELCHANGE notification (in a WM_NOTIFY message) you have to clear or hide the contents of the old tab and show the contents of the new tab yourself - the API doesn't help you with it.

                  U Offline
                  U Offline
                  User 12105981
                  wrote on last edited by
                  #8

                  Do you have any idea on how l can show the contents of the new tab as am only using TextOut function and not child windows/controls?

                  L 1 Reply Last reply
                  0
                  • U User 12105981

                    Do you have any idea on how l can show the contents of the new tab as am only using TextOut function and not child windows/controls?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    See Tab (Windows)[^].

                    1 Reply Last reply
                    0
                    • U User 12105981

                      l want to ask how l can do the following things in a tab control.

                      1)That is, for instance: In tab1, when a button is clicked, previous text is wiped and another is written. l had tried but all the texts overlaps and none cleanses off for new texts.

                      2)How can l erase the content of a tab control when l switch tabs. As in, when tab2 is clicked, contents in tab1 clears off and the things in tab2 only shows.

                      Thanks.

                      U Offline
                      U Offline
                      User 12105981
                      wrote on last edited by
                      #10

                      l have gotten a solution. l added the following lines of codes base on msdn WM_SETREDRAW message (Windows)[^]

                      SendMessage(hWnd,WM_SETREDRAW,(WPARAM)TRUE,0);
                      RedrawWindow(hWnd,NULL,NULL,RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |RDW_UPDATENOW |RDW_NOCHILDREN );

                      Thank you all who contributed.

                      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