> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# ApplyTo()

## Definition

Applies a custom **SimpleFont** object's properties (family, size, and style) to a [Windows Control](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.control?view=windowsdesktop-9.0\&redirectedfrom=MSDN).

## Method Return Value

This method does not return a value.

## Syntax

`\<simplefont\>.ApplyTo(DependencyObject target)`

## Parameters

| Parameter | Description                                                                                                                                      |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| target    | The [DependencyObject](https://msdn.microsoft.com/en-us/library/system.windows.dependencyobject\(v=vs.110\).aspx) to apply the SimpleFont object |

## Examples

```csharp
// Define the custom button control object
System.Windows.Controls.Button myButton = new System.Windows.Controls.Button
{
    Name = "myButton",
    Content = "Buy",
    Foreground = Brushes.White,
    Background = Brushes.Green,
};

// Create a custom SimpleFont object and then apply it to the button
SimpleFont myFont = new SimpleFont("Consolas", 22);

myFont.ApplyTo(myButton);
```