я отметил на этом снимке экрана красную квадратную кнопку зеленым кружком.

код.
Код: Выделить всё
public Form1()
{
InitializeComponent();
InitializeToolTips();
EnableFormDragging();
InitializeTimer();
AddTitlePanel();
SetReadOnlyTextboxes();
ValidateRecordingReady();
LoadUserSettings();
AppDomain.CurrentDomain.ProcessExit += (s, e) =>
{
SaveSettingsOnExit();
};
}
private void LoadUserSettings()
{
ffmpegTextbox.Text = Properties.Settings.Default.FfmpegFolder;
phiolaTextbox.Text = Properties.Settings.Default.PhiolaFolder;
outputFolderTextBox.Text = Properties.Settings.Default.OutputFolder;
musicFileTextBox.Text = Properties.Settings.Default.MusicFile;
chkAddMusic.Checked = Properties.Settings.Default.AddMusic;
toggleButton2.Checked = Properties.Settings.Default.MicEnabled;
toggleButtonSpeakers.Checked = Properties.Settings.Default.SpeakersEnabled;
toggleButton3.Checked = Properties.Settings.Default.MouseEnabled;
// Update labels according to loaded toggles
labelMicOnOff.Text = toggleButton2.Checked ? "ON" : "OFF";
labelSpeakersOnOff.Text = toggleButtonSpeakers.Checked ? "ON" : "OFF";
labelMouseOnOff.Text = toggleButton3.Checked ? "ON" : "OFF";
// Update static fields used elsewhere
ffmpegFolder = ffmpegTextbox.Text;
phiolaFolder = phiolaTextbox.Text;
outputFolder = outputFolderTextBox.Text;
}
private void SaveSettingsOnExit()
{
Properties.Settings.Default.Save();
Console.WriteLine("Settings saved on process exit.");
}
Код: Выделить всё
AppDomain.CurrentDomain.ProcessExit += (s, e) =>
{
SaveSettingsOnExit();
};
Подробнее здесь: https://stackoverflow.com/questions/797 ... re-stop-bu