My WPF application has a button that when pressed, opens notepad. Now i need to open notepad in x, y coordinates, how do i do that? I basically want to open my program, then open notepad and place it in (500,1000) (x, y).
<Window x:Class="MoveWindow.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MoveWindow"
mc:Ignorable="d"
Title="MainWindow" WindowStartupLocation="Manual" Height="350" Width="500">
<FrameworkElement Width="110" />
</Window>
This is the xaml.cs part:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MoveWindow
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Left = 0;
Top = 0;
// Process.Start("notepad.exe");
}
}
}