# Rhino Material panel resizing

**URL:** <https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745>\
**Category:** Rhino Developer\
**Tags:** windows\
**Created:** [January 7, 2021, 2:39am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745 "2021-01-07T02:39:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkinnane](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pkinnane/32/517903_2.png) [@pkinnane](https://discourse.mcneel.com/u/pkinnane)\
**Post date:** [January 7, 2021, 2:39am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/1 "2021-01-07T02:39:57Z")

</div>

I need the tree control to grow as the panel grows. Is this possible please?

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/0/0/b008a436531e42cbddebe94a9c3712641e8d9e5d.jpeg)

For reference, the tree is in a RhinoWindows.Controls.RenderContentUserControlCollapsibleSection. So I need it to expand and not the Notes panel.

Thanks

Paul

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [January 7, 2021, 4:47am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/2 "2021-01-07T04:47:25Z")

</div>

@maxsoder is there a way to have this work as requested?

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [January 7, 2021, 10:12am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/3 "2021-01-07T10:12:38Z")

</div>

I do not think it is possible. This is the MFC version maybe @johnc knows more?

---

<div class="post-metadata">

**Author:** ![andy](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andy/32/110490_2.png) [@andy](https://discourse.mcneel.com/u/andy)\
**Post date:** [January 7, 2021, 11:04am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/4 "2021-01-07T11:04:56Z")

</div>

There actually used to be support for this - I will log this as a bug.

[https://mcneel.myjetbrains.com/youtrack/issue/RH-62222](https://mcneel.myjetbrains.com/youtrack/issue/RH-62222)

---

<div class="post-metadata">

**Author:** ![johnc](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/johnc/32/765759_2.png) [@johnc](https://discourse.mcneel.com/u/johnc)\
**Post date:** [January 8, 2021, 6:24pm UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/5 "2021-01-08T18:24:46Z")

</div>

I have fixed this in the MFC section / holder system but the fix is only in C++ / MFC. @maxsoder is going to add the fix to the C# side. For the record, here’s how to use the fix in MFC:

In your section code you have to override `OnAttachedToHolder()` and call `SetFullHeightSection()` :

```auto
void CMySection::OnAttachedToHolder(IRhinoUiHolder& holder)
{
    __super::OnAttachedToHolder(holder);

    holder.SetFullHeightSection(*this);
}

```

This fix should be available in version 7.3

John

---

<div class="post-metadata">

**Author:** ![pkinnane](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pkinnane/32/517903_2.png) [@pkinnane](https://discourse.mcneel.com/u/pkinnane)\
**Post date:** [January 10, 2021, 11:01pm UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/6 "2021-01-10T23:01:41Z")

</div>

Thanks. My plugin is written in C#, so please let me know when it is fixed there.

Paul

---

<div class="post-metadata">

**Author:** ![walther](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/walther/32/502076_2.png) [@walther](https://discourse.mcneel.com/u/walther)\
**Post date:** [January 14, 2021, 12:42am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/7 "2021-01-14T00:42:29Z")

</div>

Please fix this ! It is really painful …

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [January 14, 2021, 5:34am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/8 "2021-01-14T05:34:08Z")

</div>

Yes, the bug is in my list and I will start working on it this week.

---

<div class="post-metadata">

**Author:** ![walther](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/walther/32/502076_2.png) [@walther](https://discourse.mcneel.com/u/walther)\
**Post date:** [January 14, 2021, 12:42pm UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/9 "2021-01-14T12:42:23Z")

</div>

Thank you, it is really appreciated !

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [January 20, 2021, 10:39am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/10 "2021-01-20T10:39:05Z")

</div>

The fix will be in v7.4.

Use EtoCollapsibleSection2 instead of EtoCollapsibleSection and override

```auto
    public override void OnAttachedToHolder(ICollapsibleSectionHolder2 holder)
    {
      base.OnAttachedToHolder(holder);

      holder.SetFullHeightSection(this);
    }

```

This will also work on the Mac version.

BR, Max

---

<div class="post-metadata">

**Author:** ![pkinnane](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pkinnane/32/517903_2.png) [@pkinnane](https://discourse.mcneel.com/u/pkinnane)\
**Post date:** [February 9, 2021, 2:32am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/11 "2021-02-09T02:32:28Z")

</div>

Thanks @maxsoder

I have my panel defined as

`public partial class OctaneMaterialTreeControl : RhinoWindows.Controls.RenderContentUserControlCollapsibleSection`

How do I implement your fix in this situation please?

Thanks

Paul

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [February 9, 2021, 5:22am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/12 "2021-02-09T05:22:05Z")

</div>

Hi @pkinnane ,

It is not possible with the RenderContentUserControlCollapsibleSection. I have to implement a new class called RenderContentUserControlCollapsibleSection2 that contains the new interface. I will do it today.

Then you only need to inherit from RenderContentUserControlCollapsibleSection2 and override the OnAttachedToHolder.

Br,Max

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [February 9, 2021, 2:33pm UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/13 "2021-02-09T14:33:53Z")

</div>

This is now implemented and it will be in v.7.4.

Br,Max

---

<div class="post-metadata">

**Author:** ![pkinnane](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pkinnane/32/517903_2.png) [@pkinnane](https://discourse.mcneel.com/u/pkinnane)\
**Post date:** [February 9, 2021, 11:53pm UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/14 "2021-02-09T23:53:48Z")

</div>

Thanks Max.

---

<div class="post-metadata">

**Author:** ![pkinnane](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pkinnane/32/517903_2.png) [@pkinnane](https://discourse.mcneel.com/u/pkinnane)\
**Post date:** [April 9, 2021, 9:56pm UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/15 "2021-04-09T21:56:11Z")

</div>

> [@maxsoder](#):
>
> ```auto
> public override void OnAttachedToHolder(ICollapsibleSectionHolder2 holder)
> {
> base.OnAttachedToHolder(holder);
> 
> holder.SetFullHeightSection(this);
> }
> 
> ```

Hi @maxsoder - I have /finally/ got to implementing this. I notice that when I scroll the main material panel, the actual tree (which now derives from RenderContentUserControlCollapsibleSection2) “jitters” as you scroll it. As you are scrolling the main material panel, the treeview panel moves to the left edge of the box it is in, and once you release the mouse it moves to the right to add a left margin.

 ![rhino1](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/0/9/9096b7fdf87200d724a27ae64c1bb0f9bf15c29c.png) ![rhino2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/3/2/232ff05231016371ff09b876b62b7c4ab91b2c51.png)

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [April 10, 2021, 5:33am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/16 "2021-04-10T05:33:02Z")

</div>

Hi @pkinnane ,

There is a know problem we have when the Windows native MFC UI hosts an Eto UI section. So sometimes we have a ficker problem. I am unsure if this is it? Is it possible to get a video of this scrollbar jitter. It would be interesting to see what is going on.

Br, Max

---

<div class="post-metadata">

**Author:** ![pkinnane](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pkinnane/32/517903_2.png) [@pkinnane](https://discourse.mcneel.com/u/pkinnane)\
**Post date:** [April 12, 2021, 8:13am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/17 "2021-04-12T08:13:11Z")

</div>

Hopefully this video shows the issue @maxsoder

[![](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/a/1/ba1a1b86105fae4473774c3a956bbe4664b513f7.jpeg "rhino") ](https://www.youtube.com/watch?v=Sl_GBgwb3D4)

Thanks

Paul

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [April 12, 2021, 8:37am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/18 "2021-04-12T08:37:14Z")

</div>

Thanks @pkinnane. I see how it jumps back and forth. I will try and reproduce this.

---

<div class="post-metadata">

**Author:** ![maxsoder](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maxsoder/32/771053_2.png) [@maxsoder](https://discourse.mcneel.com/u/maxsoder)\
**Post date:** [April 12, 2021, 11:43am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/19 "2021-04-12T11:43:53Z")

</div>

I have fixed the issue. The YT is here [https://mcneel.myjetbrains.com/youtrack/issue/RH-63771](https://mcneel.myjetbrains.com/youtrack/issue/RH-63771) and the fix will be in v.7.6.

Br, Max

---

<div class="post-metadata">

**Author:** ![pkinnane](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pkinnane/32/517903_2.png) [@pkinnane](https://discourse.mcneel.com/u/pkinnane)\
**Post date:** [April 12, 2021, 11:52am UTC](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745/20 "2021-04-12T11:52:49Z")

</div>

Awesome - thanks @maxsoder

[Next page](https://discourse.mcneel.com/t/rhino-material-panel-resizing/115745.md?page=2)
