C, Win32 API: painting on a tabcontrol [Solved]
-
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 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 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.
When you get the
TCN_SELCHANGE
notification (in aWM_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. -
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?
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.
-
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.
-
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.
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.
-
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.
-
When you get the
TCN_SELCHANGE
notification (in aWM_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.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?
-
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 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 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.