# \[FAQ\] Resizing Windows Programmatically

**URL:** <https://community.interop.io/t/faq-resizing-windows-programmatically/535>\
**Category:** io.Connect Desktop\
**Tags:** FAQs, NET\
**Created:** [March 23, 2026, 7:41am UTC](https://community.interop.io/t/faq-resizing-windows-programmatically/535 "2026-03-23T07:41:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toni.petrov](https://yyz2.discourse-cdn.com/flex028/user_avatar/community.interop.io/toni.petrov/32/17_2.png) [@toni.petrov](https://community.interop.io/u/toni.petrov)\
**Post date:** [March 23, 2026, 7:41am UTC](https://community.interop.io/t/faq-resizing-windows-programmatically/535/1 "2026-03-23T07:41:09Z")

</div>

## Question

I’m setting `_glueWindow.Bounds` in my .NET app, but the visual size of the Glue window doesn’t update, even though the value changes in the debugger. Why?

## Answer

Use `MoveResize`, which will work in both Web and Classic groups:

```auto
_glueWindow.Update(u => u.MoveResize(mro => mro.Bounds = newBounds));

```

* * *

## Question

When I use `MoveResize`, the Glue window’s final dimensions don’t match the size I passed in. What causes this?

## Answer

The Glue window includes frame decorations (header/caption bar, tab/flat chrome) that add to the overall dimensions beyond the content area. You can calculate decoration offsets before resizing, then add them back when computing new bounds:

```csharp
// Calculate decoration offsets (do this before the layout switch)
 var glueWindowBounds = _glueWindow.Bounds;
_verticalDecorations = glueWindowBounds.Height - _layout.Size.Height;
_horizontalDecorations = glueWindowBounds.Width - _layout.Size.Width;

```

Then when layout size changes, the new Glue window bounds will be:

```csharp
var glueWindowBounds = _glueWindow.Bounds;
var newWidth = _layout.Size.Width + _horizontalDecorations;
var newHeight = _layout.Size.Height + _verticalDecorations;
var newBounds = new Bounds
{
    Left = glueWindowBounds.X,
    Top = glueWindowBounds.Y,
    Width = newWidth,
    Height = newHeight
};

```

And `MoveResize` should be used to change the bounds:

```csharp
_glueWindow.Update(u => u.MoveResize(mro => mro.Bounds = newBounds));

```

* * *

## Question

My .NET view uses `AutoSize` and changes size dynamically (e.g., when the user switches tabs). Can the Glue window resize to match?

## Answer

You can subscribe to the `SizeChanged` event of an **inner layout control** (such as a `TableLayoutPanel`) and then call `MoveResize` with recalculated bounds including decoration offsets (as shown above). If you don’t have direct access to inner layout controls, you can traverse the control tree to locate the relevant component.
