tags:

views:

52

answers:

2

i used process.start in windows form to launch other program but now i want to use wpf to launch it and i dont know how and what is equivalent to it ?

<Button Margin="0,362,-432,-88" Name="activation" Click="button1_Click"
        Foreground="Blue" HorizontalAlignment="Right" Width="134" Grid.Column="1">
    activate virtual mouse
</Button>
+7  A: 

"You can still use Process.Start from the C# code behind the WPF.

In your button click handler have:

private void button1_Click(object sender, RoutedEventArgs e)
{
    Process virtualMouse = new Process();

    virtualMouse.StartInfo.FileName = "VirtualMouse.exe"; // Needs to be full path
    virtualMouse.StartInfo.Arguments = ""; // If you have any arguments

    bool result = virtualMouse.Start();
}
ChrisF
how to do it ? i dont know how will you help me please
mariam
@mariam - post what XAML you have - in your question - otherwise I could give you the wrong advice.
ChrisF
<Button Margin="0,362,-432,-88" Name="activation" Click="button1_Click" Foreground="Blue" HorizontalAlignment="Right" Width="134" Grid.Column="1">activate virtual mouse</Button>here is the xml
mariam
@mariam - you can edit your question you know.
ChrisF
A: 

hi Chris

i did what u told me ... but iam getting errors

the type or namespace name'Process' could not be found (are you missing a using directive or an assembly reference)

i dont know how to solve it ... im going crazy :(

sara