Hallo,I have created a class derived from CStatic, and I have added a member to this class, a CScrollView.
I have created this CScrollView (m_scroll) without showing it until it is necessary.
I show it with m_scroll.ShowWindow(SW_SHOW).
After this, I have had to not show the scroll, so I have done
m_scroll.ShowWindow(SW_HIDE), but this doens't work, the scroll remains visible, although not active.
I also have tried to change the m_scroll zorder, but nothing.
I don't understand what's the problem.
Is there anyone who could help me?
Thank's
doxdici
From starting, you are on a wrong path.
A scroll view (implemented by CScrollView), like any other type of view, is designed to sit in a frame window, with the respect of SDI/MDI architecture and NOT in a static control (implemented by CStatic).
What you really want to accomplish? It seems, you have added that scroll view in a static control in order to "manage scroll bars". Am I right?
I'm sorry...I haven't put CScrollView but CScrollBar...it was a lapsus
Is it so much time between having that problem and posting this topic, or we are just shooting in the dark?
Well, not even putting a scrollbar control in a static contol is a brillant ideea.
A scrollbar control (implemented by CScrollBar) is designed, like most of other controls, to sit in a dialog.
If you want to manage scrollbars in the static contol, you have to derive from CStatic, use scrollbar-related functions and handle WM_HSCROLL and/or WM_VSCROLL messages.
Bookmarks