
Untitled
By: a guest on
Feb 8th, 2012 | syntax:
C# | size: 1.15 KB | hits: 79 | expires: Never
using System.Windows;
using System.Windows.Input;
namespace WinFormWPFTest
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
System.Windows.Forms.PictureBox pictureBox;
public MainWindow()
{
InitializeComponent();
}
private void Grid_Loaded(object sender, RoutedEventArgs e)
{
System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
pictureBox = new System.Windows.Forms.PictureBox();
pictureBox.Anchor = System.Windows.Forms.AnchorStyles.Top;
pictureBox.Paint += new System.Windows.Forms.PaintEventHandler(pictureBox_Paint);
host.Child = pictureBox;
this.grid1.Children.Add(host);
}
private void pictureBox_Paint(object sender, System.Windows.Forms.PaintEventArgs args)
{
;
}
private void grid1_MouseDown(object sender, MouseButtonEventArgs e)
{
pictureBox.Invalidate();
}
}
}