Listen to Window loaded event
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title=" " Height="300" Width="300" Loaded="Window1_Loaded">
<Grid>
<Viewbox>
<TextBox x:Name="tbxEditMe" Text="Edit Me..." />
</Viewbox>
</Grid>
</Window>
//File:Window.xaml.cs
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
namespace WpfApplication1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void Window1_Loaded(object sender, RoutedEventArgs e)
{
MessageBox.Show("", "loaded");
}
}
}
Related examples in the same category