﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » StrataCollapsable Container Link Manager</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 29 May 2026 10:12:07 GMT</lastBuildDate><ttl>20</ttl><item><title>StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25396.aspx</link><description>Where can i get more information on how to use StrataCollapsable Container Link Manager?</description><pubDate>Wed, 16 Dec 2009 11:07:52 GMT</pubDate><dc:creator>Ruchika Garg</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25417.aspx</link><description>Glad that got you going! Have fun!</description><pubDate>Wed, 16 Dec 2009 11:07:52 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25416.aspx</link><description>Thank you Greg ..it worked.</description><pubDate>Wed, 16 Dec 2009 10:10:42 GMT</pubDate><dc:creator>Ruchika Garg</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25415.aspx</link><description>Thank you Greg. It worked.</description><pubDate>Wed, 16 Dec 2009 10:09:34 GMT</pubDate><dc:creator>Ruchika Garg</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25411.aspx</link><description>I was already goofing around with this, attempting to figure out the new stuff in the extended UI assembly, so thought I'd share it.  My hope is that the SF folks will take a gander at this thread and improve the link manager. :D</description><pubDate>Tue, 15 Dec 2009 15:39:37 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25410.aspx</link><description>Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You're right, it does handle things automatically. I just thought some other customization might be the ulterior motive. Also, I'm kind of obsessive about doing things with the fewest possible lines of code - it's a personal shortcoming...&amp;lt;g&amp;gt;&lt;/P&gt;&lt;P&gt;Les</description><pubDate>Tue, 15 Dec 2009 14:38:06 GMT</pubDate><dc:creator>Les Pinter</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25409.aspx</link><description>I'm not sure this is more or less efficient or easier to code than Les' example, but the attached project uses the StrataFrameCollapsableContainerLinkManager, which contains the logic to automatically collapse all other containers.  &lt;br&gt;
&lt;br&gt;
There are a couple of things to note:&lt;br&gt;
&lt;br&gt;
- The HeaderHeight isn't the height the header...or at least not the part that is shown when it is collapsed.  It is the height of the header plus the action area. I.e. if you set the ActionAreaHeight to 0, then HeaderHeight is the height of the bit shown when collapsed.&lt;br&gt;
&lt;br&gt;
- You can't use Dock = Fill.  No idea why, but flow layout containers (as I recall) don't like it. Anchoring isn't so hot either. Thus, you have to manage heights if you are going to handle resizing. The project includes an example of how to manage height changes. Width changes are left for your own experimentation :P&lt;br&gt;
&lt;br&gt;
- Setting the Height of a collapsed container is bad if the container is actually collapsed (IsBodyShown = false).  It immediately sets the height of the container (and renders it), but leaves the IsBodyShown property alone.  Thus, you now have a collapsed container that is not collapsed. Worse, since the IsBodyShown property is already false, you can't re-collapse is using that property.&lt;br&gt;
&lt;br&gt;
- Set things up in the constructor. The controls are all created but aren't actually windows controls yet (no handles, etc.), so you can set heights and IsBodyShown here and it will work. If you wait for the form Load, things get wanky.&lt;br&gt;
&lt;br&gt;
- In order to manage resizing, you'll need to handle each containers Opened event, then set the correct height based on the current flowlayoutpanel height. The project includes an example of this.  The Opening event doesn't work, due to weirdness between the Height property and the IsBodyShown property...or something like that.&lt;br&gt;
&lt;br&gt;
- If you don't need to handle resizing, its really easy to set this up. Example included there also.&lt;br&gt;
&lt;br&gt;
- By default, the link manager allows all the containers to be collapsed. Not entirely sure how to stop the last one from collapsing. I'd guess that how easy is it do do that depends on how link manager does the collapsing.&lt;br&gt;
&lt;br&gt;
- The collapsible container and the link manager are not on the toolbar by default (there still beta), so if you want to drag and drop them on a form, you'll need to add them to the toolbar manually.&lt;br&gt;
&lt;br&gt;
Attached project includes a single form with examples showing resizing (resize the form, flowlayoutpanel anchored to top and bottom) and one without resizing.&lt;br&gt;
&lt;br&gt;
Hope this helps!  :D&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 15 Dec 2009 12:54:20 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25408.aspx</link><description>Hi Ruchika,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I have a somewhat generic solution that may or may not address your needs; however, it does collapse all of the strataCollapsableContainers except the one you click on:&lt;/P&gt;&lt;P&gt;using System.Windows.Forms;&lt;BR&gt;using MicroFour.StrataFrame.UI.Windows.Forms;&lt;/P&gt;&lt;P&gt;namespace FlowPanelTest&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; public partial class Form1 : StandardForm&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Form1()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { InitializeComponent();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this could also use a ForEach loop that looks for the container type:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strataCollapsableContainer1.IsBodyShown = false;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strataCollapsableContainer2.IsBodyShown = false;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void CollapseOtherContainers ( &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StrataCollapsableContainer scc )&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; listBox1.Items.Clear();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Control ctrl in flowLayoutPanel1.Controls)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { StrataCollapsableContainer c =&amp;nbsp; ctrl as StrataCollapsableContainer;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (c != null) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { if (c == scc)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {c.IsBodyShown = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listBox1.Items.Add("Expanding " + c.Name);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {c.IsBodyShown = false;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listBox1.Items.Add("Collapsing " + c.Name);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void strataCollapsableContainer2_Click(object sender, System.EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { CollapseOtherContainers(strataCollapsableContainer2); }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void strataCollapsableContainer1_Click(object sender, System.EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { CollapseOtherContainers(strataCollapsableContainer1);&amp;nbsp; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;The zipped project is attached.&lt;/P&gt;&lt;P&gt;Les</description><pubDate>Tue, 15 Dec 2009 11:31:22 GMT</pubDate><dc:creator>Les Pinter</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25407.aspx</link><description>Hi, &lt;br&gt;
It could be achieved by tweaking Containers Dock property each time one container expends.&lt;br&gt;
You need to set Dock property of a container being expended to Fill, and other containers to Top or Bottom depending on their position relative to the expending control. &lt;br&gt;
&lt;br&gt;
For example, If you have 3 Collapsible Containers (at the Top, Middle, and Bottom) your code would look something like this:&lt;br&gt;
&lt;br&gt;
   [codesnippet]private void Form1_Load(object sender, EventArgs e)&lt;br&gt;
        {&lt;br&gt;
           &lt;br&gt;
            strataCollapsableContainerTop.IsBodyShown = true;&lt;br&gt;
&lt;br&gt;
       &lt;br&gt;
            &lt;br&gt;
&lt;br&gt;
            strataCollapsableContainerBottom.IsBodyShown = false;&lt;br&gt;
            strataCollapsableContainerMiddle.IsBodyShown = false;&lt;br&gt;
&lt;br&gt;
            strataCollapsableContainerLinkManager1.AddContainer(strataCollapsableContainerBottom);&lt;br&gt;
            strataCollapsableContainerLinkManager1.AddContainer(strataCollapsableContainerTop);&lt;br&gt;
            strataCollapsableContainerLinkManager1.AddContainer(strataCollapsableContainerMiddle);&lt;br&gt;
        &lt;br&gt;
&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
       &lt;br&gt;
&lt;br&gt;
        private void strataCollapsableContainerMiddle_Opened(object sender, EventArgs e)&lt;br&gt;
        {&lt;br&gt;
            strataCollapsableContainerMiddle.Dock = DockStyle.Fill;&lt;br&gt;
&lt;br&gt;
            strataCollapsableContainerBottom.Dock = DockStyle.Bottom;&lt;br&gt;
            strataCollapsableContainerTop.Dock = DockStyle.Top;&lt;br&gt;
&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
        private void strataCollapsableContainerTop_Opened(object sender, EventArgs e)&lt;br&gt;
        {&lt;br&gt;
            strataCollapsableContainerTop.Dock = DockStyle.Fill;&lt;br&gt;
            &lt;br&gt;
            strataCollapsableContainerBottom.Dock = DockStyle.Bottom;&lt;br&gt;
            strataCollapsableContainerMiddle.Dock = DockStyle.Bottom;&lt;br&gt;
          &lt;br&gt;
&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
        private void strataCollapsableContainerBottom_Opened(object sender, EventArgs e)&lt;br&gt;
        {&lt;br&gt;
            strataCollapsableContainerBottom.Dock = DockStyle.Fill;&lt;br&gt;
&lt;br&gt;
            strataCollapsableContainerMiddle.Dock = DockStyle.Top;&lt;br&gt;
            strataCollapsableContainerTop.Dock = DockStyle.Top;&lt;br&gt;
        }[/codesnippet]</description><pubDate>Tue, 15 Dec 2009 09:50:06 GMT</pubDate><dc:creator>Leonard P.</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25406.aspx</link><description>it didn't work.. :-(</description><pubDate>Tue, 15 Dec 2009 09:33:52 GMT</pubDate><dc:creator>Ruchika Garg</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25405.aspx</link><description>Yeah that will work..thanks a lot ..</description><pubDate>Tue, 15 Dec 2009 08:52:23 GMT</pubDate><dc:creator>Ruchika Garg</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25398.aspx</link><description>This is pretty easy.  First, you'll want to drop the SF collapsible containers into a FlowLayoutPanel. This will handle the resizing.  Next, you need to add containers to the link manager manually in the constructor of the form. I'm hoping they make this declarative soon, but form now you just need to do it in code.  Finally, you may want to set which panels are initially collapsed, also in constructor.&lt;br&gt;
&lt;br&gt;
Hope that gets you started! :D</description><pubDate>Mon, 14 Dec 2009 14:59:14 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: StrataCollapsable Container Link Manager</title><link>http://forum.strataframe.net/FindPost25397.aspx</link><description>I want to put two strataframe collapsable control on one window and want the functionality where when user collapse one container the other container should expand and resize itself to fill the entire &amp;#119;indow.</description><pubDate>Mon, 14 Dec 2009 11:38:25 GMT</pubDate><dc:creator>Ruchika Garg</dc:creator></item></channel></rss>