ApplyTo()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > SimpleFont >

ApplyTo()

Previous page Return to chapter overview Next page

Definition

Applies a custom SimpleFont object's properties (family, size, and style) to a Windows Control

 

Method Return Value

This method does not return a value.

 

Syntax

<SimpleFont>.ApplyTo(DependencyObject target)

 

target

The DependencyObject to apply the SimpleFont object

 

 

Examples

ns

// 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);