Posts

Showing posts from October, 2010

How to replace WPF Expander's Header Image with custom Up/Down images

1) Place this code in the Resources section of your XAML UserControl or Page 2) Replace the highlighted image path with the images you want to use for WPF Expnder control Header    <UserControl.Resources>         <Color x:Key="WindowColor">#FFE8EDF9</Color>         <Color x:Key="ContentAreaColorLight">#FFC5CBF9</Color>         <Color x:Key="ContentAreaColorDark">#FF7381F9</Color>         <Color x:Key="DisabledControlLightColor">#FFE8EDF9</Color>         <Color x:Key="DisabledControlDarkColor">#FFC5CBF9</Color>         <Color x:Key="DisabledForegroundColor">#FF888888</Color>         <Color x:Key="SelectedBackgroundColor">#FFC5CBF9</Color>         <Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>         <Color x:Key="ControlLightColor">White</Color>         <Color x:Key=&q

Run .Exe or .Bat file from C# WPF with arguments

System.Diagnostics.Process.Start() can launch an executable from your program (it could be a Console, WPF or WinForm application). The Process.Start() has an overload that takes 2 arguments. The first argument is the path of the executable and the second argument takes a string representing the arguments to be passed to the executable. It's always a good idea to make sure the file exists before you try and launch it with the System.Diagnostics.Process.Start() call. string  ExecutableFilePath = @“C:\Programfiles\OSP\bin\ospdesktop.bat"; string Arguments = @"-appArgs -application com.openspirit.rcp.dataselector.application"; if (File.Exists(ExecutableFilePath ))      System.Diagnostics.Process.Start(ExecutableFilePath , Arguments);