-
December 16th, 2011, 05:05 AM
#1
SW_HIDE and CScrollView
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
-
December 16th, 2011, 06:16 AM
#2
Re: SW_HIDE and CScrollView
Have you tried to update the window using UpdateWindow method? If not try invoking UpdateWindow after ShowWindow
Thanks,
dwurity
-
December 16th, 2011, 06:25 AM
#3
Re: SW_HIDE and CScrollView
yes,
i have done also Updatewindow, but nothing changes
-
December 16th, 2011, 06:46 AM
#4
Re: SW_HIDE and CScrollView
Are you trying to hide ScrollView or scrollbar in ScrollView?
Thanks,
dwurity
-
December 16th, 2011, 06:50 AM
#5
Re: SW_HIDE and CScrollView
sorry....I have used CScrollBar, m_scroll is of CScrollBar type
-
December 16th, 2011, 06:56 AM
#6
Re: SW_HIDE and CScrollView
Try calling ShowScrollBar() method.
Thanks,
dwurity
-
December 16th, 2011, 07:04 AM
#7
Re: SW_HIDE and CScrollView
I've just tried...no news
-
December 16th, 2011, 07:53 AM
#8
Re: SW_HIDE and CScrollView
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?
-
December 16th, 2011, 07:53 AM
#9
Re: SW_HIDE and CScrollView
Originally Posted by doxdici
Hallo,I have created a class derived from CStatic, and I have added a member to this class, a CScrollView.
That sounds like a very odd thing to do. Did you add some kind of frame for the view?
-
December 16th, 2011, 07:57 AM
#10
Re: SW_HIDE and CScrollView
I'm sorry...I haven't put CScrollView but CScrollBar...it was a lapsus
-
December 16th, 2011, 08:14 AM
#11
Re: SW_HIDE and CScrollView
Originally Posted by doxdici
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|