Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement