CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Oct 2004
    Posts
    270

    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

  2. #2
    Join Date
    Aug 2004
    Location
    Chennai, India.
    Posts
    380

    Smile Re: SW_HIDE and CScrollView

    Have you tried to update the window using UpdateWindow method? If not try invoking UpdateWindow after ShowWindow

    Thanks,
    dwurity

  3. #3
    Join Date
    Oct 2004
    Posts
    270

    Re: SW_HIDE and CScrollView

    yes,
    i have done also Updatewindow, but nothing changes

  4. #4
    Join Date
    Aug 2004
    Location
    Chennai, India.
    Posts
    380

    Re: SW_HIDE and CScrollView

    Are you trying to hide ScrollView or scrollbar in ScrollView?

    Thanks,
    dwurity

  5. #5
    Join Date
    Oct 2004
    Posts
    270

    Re: SW_HIDE and CScrollView

    sorry....I have used CScrollBar, m_scroll is of CScrollBar type

  6. #6
    Join Date
    Aug 2004
    Location
    Chennai, India.
    Posts
    380

    Lightbulb Re: SW_HIDE and CScrollView

    Try calling ShowScrollBar() method.

    Thanks,
    dwurity

  7. #7
    Join Date
    Oct 2004
    Posts
    270

    Re: SW_HIDE and CScrollView


    I've just tried...no news

  8. #8
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    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?
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: SW_HIDE and CScrollView

    Quote Originally Posted by doxdici View Post
    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?

  10. #10
    Join Date
    Oct 2004
    Posts
    270

    Re: SW_HIDE and CScrollView

    I'm sorry...I haven't put CScrollView but CScrollBar...it was a lapsus

  11. #11
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: SW_HIDE and CScrollView

    Quote Originally Posted by doxdici View Post
    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.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured