Advertisement
Guest User

Untitled

a guest
Feb 8th, 2012
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. using System.Windows;
  2. using System.Windows.Input;
  3.  
  4. namespace WinFormWPFTest
  5. {
  6.     /// <summary>
  7.     /// Interaction logic for MainWindow.xaml
  8.     /// </summary>
  9.     public partial class MainWindow : Window
  10.     {
  11.         System.Windows.Forms.PictureBox pictureBox;
  12.         public MainWindow()
  13.         {
  14.             InitializeComponent();
  15.         }
  16.  
  17.         private void Grid_Loaded(object sender, RoutedEventArgs e)
  18.         {
  19.             System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
  20.             pictureBox = new System.Windows.Forms.PictureBox();
  21.             pictureBox.Anchor = System.Windows.Forms.AnchorStyles.Top;
  22.             pictureBox.Paint += new System.Windows.Forms.PaintEventHandler(pictureBox_Paint);
  23.             host.Child = pictureBox;
  24.             this.grid1.Children.Add(host);
  25.         }
  26.  
  27.         private void pictureBox_Paint(object sender, System.Windows.Forms.PaintEventArgs args)
  28.         {
  29.             ;
  30.         }
  31.  
  32.         private void grid1_MouseDown(object sender, MouseButtonEventArgs e)
  33.         {
  34.             pictureBox.Invalidate();
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement