Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

Visual Studio WPF Form, pass Combobox selection to Process StartInfo.Arguments?

$
0
0

I have a combo box that selects what language the game will run in.

<ComboBox x:Name="Lang" HorizontalAlignment="Left" Margin="600,418,0,0" VerticalAlignment="Top" Width="73" SelectionChanged="ComboBox_SelectionChanged">
            <ComboBoxItem Content="English" Name="en" IsSelected="True"></ComboBoxItem>
            <ComboBoxItem Content="French" Name="fr"></ComboBoxItem>
            <ComboBoxItem Content="German" Name="de"></ComboBoxItem>
        </ComboBox>

I also have a button to launch our game's EXE

private void Button_Play(object sender, RoutedEventArgs e)
        {
            Process Game = new Process();

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

            bool result = Game …

Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>