System.Windows.Forms.Application.StartupPath
с# how to get aplication path / с# получить путь к вашей программе
C# WPF Control with transparent background
//Set background color mycontrol.Background = Brushes.Green; //Not transparent mycontrol.Opacity=1; //Half transparent mycontrol.Opacity=0.5;
How to add a CheckBox to a Menu Item in WPF
xaml
c#
- <MenuItem IsCheckable="True" x:Name="_showSolutionExplorer" Header="Solution Explorer" Click="_showContent_Click"></MenuItem>
c#
- private void _showContent_Click(object sender, RoutedEventArgs e)
- {
- If ((sender as MenuItem).IsChecked)
- MessageBox.Show("MenuItem is checked");
- else
- MessageBox.Show("MenuItem is not checked");
- }
c# WPF change foreground
- myobject.Foreground = Brushes.Black;
OR
- myobject.Foreground = new SolidColorBrush(Colors.Green);
C# Write and read config file
app.config
- <?xml version="1.0"?>
- <configuration>
- <appSettings>
- <add key="oldPlace" value="4" />
- </appSettings>
- </configuration>
Write:
- System.Configuration.Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- config.AppSettings.Settings["oldPlace"].Value = "3";
- config.Save(ConfigurationSaveMode.Modified);
- ConfigurationManager.RefreshSection("appSettings");
Read:
- string value = ConfigurationManager.AppSettings["oldPlace"];
Subscribe to:
Posts (Atom)