CSplitterWnd How to hide a row
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: CSplitterWnd How to hide a row

  1. #1
    Join Date
    Apr 2005
    Posts
    78

    Question CSplitterWnd How to hide a row

    I have a splitter window 1 column and 2 rows. On specific user events I want to display 2 rows else I want to hide the bottom row.

    I have tried the following, but makes no visual difference, nothing changes?

    // hide bottom row pane
    if( show == false && mShow == true ){
    mShow = false;
    pWnd->SetRowInfo(1,0,0); // hide
    pWnd->RecalcLayout();
    }else if( show == true && mShow == false ){
    pWnd->SetRowInfo(1,400,0); // show
    pWnd->RecalcLayout();
    mShow = true;
    }

    Where pWnd is the splitter. How can i programatically hide the bottom row?

    Thanks in advance.

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: CSplitterWnd How to hide a row

    SetRowInfo() doesn't specify the actual size, but the "idea size". It's not the same. I don't wonder you see no effect.

    Maybe you can use DeleteRow() and SplitColumn() to delete and insert rows().
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Apr 2005
    Posts
    78

    Re: CSplitterWnd How to hide a row

    Quote Originally Posted by cilu View Post
    SetRowInfo() doesn't specify the actual size, but the "idea size". It's not the same. I don't wonder you see no effect.

    Maybe you can use DeleteRow() and SplitColumn() to delete and insert rows().
    I dont want to delete anything only hide a row based on what the user selects elsewhere. So it needs to toggle between showing only 1 row or 2 rows.

    I understand I would need to use dynamic splitters to do what you suggest but then I dont want the user to be able to split the view from the front end.

    Im happy with a static, but just need to hide bottom pane. I cant believe its so difficult, always the problem with MFC.

    For now I just looking for the most easy way to hide the bottom row in a two row splitter?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,355

  5. #5
    Join Date
    Apr 2005
    Posts
    78

    Re: CSplitterWnd How to hide a row

    The Show Hide static panes would seem to be the one I want, the other is too much solution.
    The problem with the first example, the code is for hiding/showing columns not rows.

    Im not confident in rewriting it for hiding a row? Can anyone help?

    Thanks for your responses so far, I feel im getting nearer...

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,355

    Re: CSplitterWnd How to hide a row

    Quote Originally Posted by PRMARJORAM View Post
    Im not confident in rewriting it for hiding a row? Can anyone help?...
    There is an example somewhere in the comments to this article
    Victor Nijegorodov

  7. #7
    Join Date
    Apr 2005
    Posts
    78

    Smile Re: CSplitterWnd How to hide a row

    Yep thanks, just found it.
    Just plugged it into my code and it works!!!! Yippee Yipee

    Thanks.

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,355

    Re: CSplitterWnd How to hide a row

    You are welcome!

    PS: some years ago I also implemented this (or similar) code to my project.
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center