> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/code/gum-code-reference/interactivegue/raisechildreneventsoutsideofbounds.md).

# RaiseChildrenEventsOutsideOfBounds

## Introduction

RaiseChildrenEventsOutsideOfBounds determines whether InteractiveGue instances check all children for events even if the children fall outside of the bounds of the instance. This is false by default for performance reasons, but is needed if a parent has children which are intentionally placed outside of its bounds.

## Code Example - Setting RaiseChildrenEventsOutsideOfBounds

By default RaiseChildrenEventsOutsideOfBounds is set to false. This means that all parents only raise events for their children if the cursor is within the bounds of the parent. For example, the following code adds a wide Button to a narrow StackLayout. The Button only receives clicks if the Cursor is within the bounds of the StackLayout.

```csharp
// Initialize
var mainPanel = new StackPanel();
var visual = mainPanel.Visual;
mainPanel.Visual.AddToRoot();

var label = new Label();
mainPanel.AddChild(label);

mainPanel.Visual.Width = 100;
mainPanel.Visual.Height = 100;
mainPanel.Visual.WidthUnits = Gum.DataTypes.DimensionUnitType.Absolute;
mainPanel.Visual.HeightUnits = Gum.DataTypes.DimensionUnitType.Absolute;
// If this is false, then no events are raised when the cursor is 
// outside of the bounds of mainPanel
mainPanel.Visual.RaiseChildrenEventsOutsideOfBounds = false;

var button = new Button();
button.Visual.Width = 300;
button.Click += (_, _) => label.Text = $"Clicked at {DateTime.Now}";
mainPanel.AddChild(button);
```

<figure><img src="/files/IF9gH9qwbGf7jKoIYzDn" alt=""><figcaption><p>Clicks only register on the left side of the button</p></figcaption></figure>

Notice that all events are disabled when outside of the bounds of mainPanel including hover, so the button does not respond to events.

The code can be modified to enable clicks outside of the mainPanel:

```csharp
// Initialize
var mainPanel = new StackPanel();
var visual = mainPanel.Visual;
mainPanel.Visual.AddToRoot();

var label = new Label();
mainPanel.AddChild(label);

mainPanel.Visual.Width = 100;
mainPanel.Visual.Height = 100;
mainPanel.Visual.WidthUnits = Gum.DataTypes.DimensionUnitType.Absolute;
mainPanel.Visual.HeightUnits = Gum.DataTypes.DimensionUnitType.Absolute;
// If this is false, then no events are raised when the cursor is
// outside of the bounds of mainPanel
mainPanel.Visual.RaiseChildrenEventsOutsideOfBounds = true;

var button = new Button();
button.Visual.Width = 300;
button.Click += (_, _) => label.Text = $"Clicked at {DateTime.Now}";
mainPanel.AddChild(button);
```

<figure><img src="/files/5hlPoAkGzLX1Drq73sr8" alt=""><figcaption><p>Clicks are now registered outside of the bounds of the mainPanel</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flatredball.com/gum/code/gum-code-reference/interactivegue/raisechildreneventsoutsideofbounds.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
