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.
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().
Re: CSplitterWnd How to hide a row
Quote:
Originally Posted by
cilu
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?
Re: CSplitterWnd How to hide a row
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...
Re: CSplitterWnd How to hide a row
Quote:
Originally Posted by
PRMARJORAM
Im not confident in rewriting it for hiding a row? Can anyone help?...
There is an example somewhere in the comments to this article
Re: CSplitterWnd How to hide a row
Yep thanks, just found it.
Just plugged it into my code and it works!!!! Yippee Yipee
Thanks.
Re: CSplitterWnd How to hide a row
You are welcome!
PS: some years ago I also implemented this (or similar) code to my project. ;)