diff --git a/Code/Form1.cs b/Code/Form1.cs index 28eb611..daf2372 100644 --- a/Code/Form1.cs +++ b/Code/Form1.cs @@ -504,7 +504,7 @@ namespace Flowframes if (Program.busy) reason = "The program is still busy."; - DialogResult dialog = MessageBox.Show($"Are you sure you want to exit the program?\n\n{reason}", "Are you sure?", MessageBoxButtons.YesNo); + DialogResult dialog = UiUtils.ShowMessageBox($"Are you sure you want to exit the program?\n\n{reason}", "Are you sure?", MessageBoxButtons.YesNo); if (dialog == DialogResult.No) e.Cancel = true; @@ -554,7 +554,7 @@ namespace Flowframes private void cancelBtn_Click(object sender, EventArgs e) { - DialogResult dialog = MessageBox.Show($"Are you sure you want to cancel the interpolation?", "Are you sure?", MessageBoxButtons.YesNo); + DialogResult dialog = UiUtils.ShowMessageBox($"Are you sure you want to cancel the interpolation?", "Are you sure?", MessageBoxButtons.YesNo); if (dialog == DialogResult.Yes) { diff --git a/Code/Forms/DebugForm.cs b/Code/Forms/DebugForm.cs index eac6edd..c131017 100644 --- a/Code/Forms/DebugForm.cs +++ b/Code/Forms/DebugForm.cs @@ -39,8 +39,9 @@ namespace Flowframes.Forms if (!configGridChanged) return; - DialogResult dialogResult = MessageBox.Show($"Save the modified configuration file?", "Save Configuration?", MessageBoxButtons.YesNo); - + DialogResult dialogResult = UiUtils.ShowMessageBox($"Save the modified configuration file?", "Save Configuration?", MessageBoxButtons.YesNo); + + if (dialogResult == DialogResult.Yes) DebugFormHelper.SaveGrid(configDataGrid); } diff --git a/Code/Forms/MessageForm.Designer.cs b/Code/Forms/MessageForm.Designer.cs index 899beff..d873dd1 100644 --- a/Code/Forms/MessageForm.Designer.cs +++ b/Code/Forms/MessageForm.Designer.cs @@ -29,7 +29,9 @@ private void InitializeComponent() { this.textLabel = new System.Windows.Forms.Label(); - this.okBtn = new HTAlt.WinForms.HTButton(); + this.btn1 = new HTAlt.WinForms.HTButton(); + this.btn2 = new HTAlt.WinForms.HTButton(); + this.btn3 = new HTAlt.WinForms.HTButton(); this.SuspendLayout(); // // textLabel @@ -42,20 +44,50 @@ this.textLabel.Size = new System.Drawing.Size(0, 13); this.textLabel.TabIndex = 8; // - // okBtn + // btn1 // - this.okBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.okBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.okBtn.FlatAppearance.BorderSize = 0; - this.okBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.okBtn.ForeColor = System.Drawing.Color.White; - this.okBtn.Location = new System.Drawing.Point(232, 126); - this.okBtn.Name = "okBtn"; - this.okBtn.Size = new System.Drawing.Size(100, 23); - this.okBtn.TabIndex = 46; - this.okBtn.Text = "OK"; - this.okBtn.UseVisualStyleBackColor = false; - this.okBtn.Click += new System.EventHandler(this.okBtn_Click); + this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.btn1.FlatAppearance.BorderSize = 0; + this.btn1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btn1.ForeColor = System.Drawing.Color.White; + this.btn1.Location = new System.Drawing.Point(232, 126); + this.btn1.Name = "btn1"; + this.btn1.Size = new System.Drawing.Size(100, 23); + this.btn1.TabIndex = 46; + this.btn1.Text = "OK"; + this.btn1.UseVisualStyleBackColor = false; + this.btn1.Click += new System.EventHandler(this.btn1_Click); + // + // btn2 + // + this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.btn2.FlatAppearance.BorderSize = 0; + this.btn2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btn2.ForeColor = System.Drawing.Color.White; + this.btn2.Location = new System.Drawing.Point(126, 126); + this.btn2.Name = "btn2"; + this.btn2.Size = new System.Drawing.Size(100, 23); + this.btn2.TabIndex = 47; + this.btn2.Text = "OK"; + this.btn2.UseVisualStyleBackColor = false; + this.btn2.Click += new System.EventHandler(this.btn2_Click); + // + // btn3 + // + this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.btn3.FlatAppearance.BorderSize = 0; + this.btn3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btn3.ForeColor = System.Drawing.Color.White; + this.btn3.Location = new System.Drawing.Point(20, 126); + this.btn3.Name = "btn3"; + this.btn3.Size = new System.Drawing.Size(100, 23); + this.btn3.TabIndex = 48; + this.btn3.Text = "OK"; + this.btn3.UseVisualStyleBackColor = false; + this.btn3.Click += new System.EventHandler(this.btn3_Click); // // MessageForm // @@ -63,7 +95,9 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.ClientSize = new System.Drawing.Size(344, 161); - this.Controls.Add(this.okBtn); + this.Controls.Add(this.btn3); + this.Controls.Add(this.btn2); + this.Controls.Add(this.btn1); this.Controls.Add(this.textLabel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.MaximizeBox = false; @@ -71,6 +105,7 @@ this.Name = "MessageForm"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MessageForm_FormClosing); this.Load += new System.EventHandler(this.MessageForm_Load); this.ResumeLayout(false); this.PerformLayout(); @@ -80,6 +115,8 @@ #endregion private System.Windows.Forms.Label textLabel; - private HTAlt.WinForms.HTButton okBtn; + private HTAlt.WinForms.HTButton btn1; + private HTAlt.WinForms.HTButton btn2; + private HTAlt.WinForms.HTButton btn3; } } \ No newline at end of file diff --git a/Code/Forms/MessageForm.cs b/Code/Forms/MessageForm.cs index 99f624a..e14a8d1 100644 --- a/Code/Forms/MessageForm.cs +++ b/Code/Forms/MessageForm.cs @@ -14,11 +14,16 @@ namespace Flowframes.Forms { private string _text = ""; private string _title = ""; + private MessageBoxButtons _btns; - public MessageForm(string text, string title) + private bool _dialogResultSet = false; + + public MessageForm(string text, string title, MessageBoxButtons buttons = MessageBoxButtons.OK) { _text = text; _title = title; + _btns = buttons; + InitializeComponent(); } @@ -26,8 +31,34 @@ namespace Flowframes.Forms { Text = _title; textLabel.Text = _text; + + if(_btns == MessageBoxButtons.OK) + { + SetButtons(true, false, false); + btn1.Text = "OK"; + AcceptButton = btn1; + } + else if(_btns == MessageBoxButtons.YesNo) + { + SetButtons(true, true, false); + btn1.Text = "No"; + btn2.Text = "Yes"; + AcceptButton = btn2; + CancelButton = btn1; + } + else if (_btns == MessageBoxButtons.YesNoCancel) + { + SetButtons(true, true, true); + btn1.Text = "Cancel"; + btn2.Text = "No"; + btn3.Text = "Yes"; + AcceptButton = btn3; + CancelButton = btn1; + } + Size labelSize = GetLabelSize(textLabel); Size = new Size((labelSize.Width + 60).Clamp(360, Program.mainForm.Size.Width), (labelSize.Height + 120).Clamp(200, Program.mainForm.Size.Height)); + CenterToScreen(); } @@ -36,9 +67,50 @@ namespace Flowframes.Forms return TextRenderer.MeasureText(label.Text, label.Font, label.ClientSize, TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl); } - private void okBtn_Click(object sender, EventArgs e) + private void SetButtons(bool b1, bool b2, bool b3) { + btn1.Visible = b1; + btn2.Visible = b2; + btn3.Visible = b3; + } + + private void btn1_Click(object sender, EventArgs e) + { + if (_btns == MessageBoxButtons.OK) // OK Button + DialogResult = DialogResult.OK; + else if (_btns == MessageBoxButtons.YesNo) // No Button + DialogResult = DialogResult.No; + else if (_btns == MessageBoxButtons.YesNoCancel) // Cancel Button + DialogResult = DialogResult.Cancel; + + _dialogResultSet = true; Close(); } + + private void btn2_Click(object sender, EventArgs e) + { + if (_btns == MessageBoxButtons.YesNo) // Yes Button + DialogResult = DialogResult.Yes; + else if (_btns == MessageBoxButtons.YesNoCancel) // No Button + DialogResult = DialogResult.No; + + _dialogResultSet = true; + Close(); + } + + private void btn3_Click(object sender, EventArgs e) + { + if (_btns == MessageBoxButtons.YesNoCancel) // Yes Button + DialogResult = DialogResult.Yes; + + _dialogResultSet = true; + Close(); + } + + private void MessageForm_FormClosing(object sender, FormClosingEventArgs e) + { + if (_btns != MessageBoxButtons.OK && !_dialogResultSet) + e.Cancel = true; + } } } diff --git a/Code/Forms/SettingsForm.cs b/Code/Forms/SettingsForm.cs index 87856f5..5934a82 100644 --- a/Code/Forms/SettingsForm.cs +++ b/Code/Forms/SettingsForm.cs @@ -2,6 +2,7 @@ using Flowframes.IO; using Flowframes.Media; using Flowframes.MiscUtils; +using Flowframes.Ui; using Microsoft.WindowsAPICodePack.Dialogs; using System; using System.Drawing; @@ -239,7 +240,7 @@ namespace Flowframes.Forms private void cmdDebugMode_SelectedIndexChanged(object sender, EventArgs e) { if (initialized && cmdDebugMode.SelectedIndex == 2) - MessageBox.Show("If you enable this, you need to close the CMD window manually after the process has finished, otherwise processing will be paused!", "Notice"); + UiUtils.ShowMessageBox("If you enable this, you need to close the CMD window manually after the process has finished, otherwise processing will be paused!", UiUtils.MessageType.Warning); } private void dedupMode_SelectedIndexChanged(object sender, EventArgs e) @@ -287,7 +288,7 @@ namespace Flowframes.Forms private async void resetBtn_Click(object sender, EventArgs e) { - DialogResult dialog = MessageBox.Show($"Are you sure you want to reset the configuration?", "Are you sure?", MessageBoxButtons.YesNo); + DialogResult dialog = UiUtils.ShowMessageBox($"Are you sure you want to reset the configuration?", "Are you sure?", MessageBoxButtons.YesNo); if (dialog == DialogResult.No) return; diff --git a/Code/IO/IoUtils.cs b/Code/IO/IoUtils.cs index 88be981..ddfc650 100644 --- a/Code/IO/IoUtils.cs +++ b/Code/IO/IoUtils.cs @@ -345,7 +345,7 @@ namespace Flowframes.IO Fraction guiFps = Program.mainForm.GetCurrentSettings().inFps; - DialogResult dialogResult = MessageBox.Show("A frame rate file has been found in the parent directory.\n\n" + + DialogResult dialogResult = UiUtils.ShowMessageBox("A frame rate file has been found in the parent directory.\n\n" + $"Click \"Yes\" to use frame rate from the file ({fps}) or \"No\" to use current FPS set in GUI ({guiFps})", "Load Frame Rate From fps.ini?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) return fps; @@ -664,7 +664,7 @@ namespace Flowframes.IO { Logger.Log($"Can't write to {dir}! {e.Message}", errMode == ErrorMode.HiddenLog); if (errMode == ErrorMode.Messagebox && !BatchProcessing.busy) - MessageBox.Show($"Can't write to {dir}!\n\n{e.Message}", "Error"); + UiUtils.ShowMessageBox($"Can't write to {dir}!\n\n{e.Message}", UiUtils.MessageType.Error); return false; } } diff --git a/Code/Main/Export.cs b/Code/Main/Export.cs index 73b48c0..6e66538 100644 --- a/Code/Main/Export.cs +++ b/Code/Main/Export.cs @@ -14,6 +14,7 @@ using Flowframes.MiscUtils; using Flowframes.Os; using System.Collections.Generic; using Newtonsoft.Json; +using Flowframes.Ui; namespace Flowframes.Main { @@ -68,7 +69,7 @@ namespace Flowframes.Main catch (Exception e) { Logger.Log("FramesToVideo Error: " + e.Message, false); - MessageBox.Show("An error occured while trying to convert the interpolated frames to a video.\nCheck the log for details."); + UiUtils.ShowMessageBox("An error occured while trying to convert the interpolated frames to a video.\nCheck the log for details.", UiUtils.MessageType.Error); } } @@ -252,7 +253,7 @@ namespace Flowframes.Main Logger.Log("ChunksToVideo Error: " + e.Message, isBackup); if (!isBackup) - MessageBox.Show("An error occured while trying to merge the video chunks.\nCheck the log for details."); + UiUtils.ShowMessageBox("An error occured while trying to merge the video chunks.\nCheck the log for details.", UiUtils.MessageType.Error); } Logger.Log($"Merged video chunks in {sw}", true); diff --git a/Code/Main/Interpolate.cs b/Code/Main/Interpolate.cs index 07cceb0..1d8a6b4 100644 --- a/Code/Main/Interpolate.cs +++ b/Code/Main/Interpolate.cs @@ -242,7 +242,7 @@ namespace Flowframes { if (!BatchProcessing.busy && IoUtils.GetAmountOfFiles(Path.Combine(currentSettings.tempFolder, Paths.resumeDir), true) > 0) { - DialogResult dialogResult = MessageBox.Show($"Delete the temp folder (Yes) or keep it for resuming later (No)?", "Delete temporary files?", MessageBoxButtons.YesNo); + DialogResult dialogResult = UiUtils.ShowMessageBox($"Delete the temp folder (Yes) or keep it for resuming later (No)?", "Delete temporary files?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) Task.Run(async () => { await IoUtils.TryDeleteIfExistsAsync(currentSettings.tempFolder); }); diff --git a/Code/Main/InterpolateSteps.cs b/Code/Main/InterpolateSteps.cs index 0a76cd6..207f1c7 100644 --- a/Code/Main/InterpolateSteps.cs +++ b/Code/Main/InterpolateSteps.cs @@ -135,7 +135,7 @@ namespace Flowframes.Main public static async Task Reset() { - DialogResult dialog = MessageBox.Show($"Are you sure you want to remove all temporary files?", "Are you sure?", MessageBoxButtons.YesNo); + DialogResult dialog = UiUtils.ShowMessageBox($"Are you sure you want to remove all temporary files?", "Are you sure?", MessageBoxButtons.YesNo); if (dialog == DialogResult.Yes) await Cleanup(true); diff --git a/Code/Main/InterpolateUtils.cs b/Code/Main/InterpolateUtils.cs index 4810d43..7d773d6 100644 --- a/Code/Main/InterpolateUtils.cs +++ b/Code/Main/InterpolateUtils.cs @@ -225,7 +225,7 @@ namespace Flowframes.Main { string enc = FfmpegUtils.GetEnc(FfmpegUtils.GetCodec(I.currentSettings.outMode)); - float maxAv1Fps = 480; + float maxAv1Fps = 240; if (enc.ToLower().Contains("av1") && encodeFps > maxAv1Fps) { diff --git a/Code/Os/Python.cs b/Code/Os/Python.cs index d17b646..ff48242 100644 --- a/Code/Os/Python.cs +++ b/Code/Os/Python.cs @@ -1,5 +1,6 @@ using Flowframes.IO; using Flowframes.MiscUtils; +using Flowframes.Ui; using System; using System.Collections.Generic; using System.Diagnostics; @@ -81,7 +82,7 @@ namespace Flowframes.Os { if (!quiet) { - MessageBox.Show("Neither the Flowframes Python Runtime nor System Python installation could be found!\nEither redownload Flowframes with the embedded Python runtime enabled or install Python/Pytorch yourself."); + UiUtils.ShowMessageBox("Neither the Flowframes Python Runtime nor System Python installation could be found!\nEither redownload Flowframes with the embedded Python runtime enabled or install Python/Pytorch yourself."); Interpolate.Cancel("Neither the Flowframes Python Runtime nor System Python installation could be found!"); } } diff --git a/Code/Os/StartupChecks.cs b/Code/Os/StartupChecks.cs index 4e03003..286ecb7 100644 --- a/Code/Os/StartupChecks.cs +++ b/Code/Os/StartupChecks.cs @@ -5,6 +5,7 @@ using System.IO; using System.Threading.Tasks; using System.Windows.Forms; using Flowframes.IO; +using Flowframes.Ui; namespace Flowframes.Os { @@ -39,7 +40,7 @@ namespace Flowframes.Os { if (!File.Exists(Paths.GetVerPath()) && Paths.GetExeDir().ToLower().Contains("temp")) { - MessageBox.Show("You seem to be running Flowframes out of an archive.\nPlease extract the whole archive first!", "Error"); + UiUtils.ShowMessageBox("You seem to be running Flowframes out of an archive.\nPlease extract the whole archive first!", UiUtils.MessageType.Error); IoUtils.TryDeleteIfExists(Paths.GetDataPath()); Application.Exit(); } @@ -49,7 +50,7 @@ namespace Flowframes.Os if (Is32Bit() && !Config.GetBool("allow32Bit", false)) { - MessageBox.Show("This application is not compatible with 32 bit operating systems!", "Error"); + UiUtils.ShowMessageBox("This application is not compatible with 32 bit operating systems!", UiUtils.MessageType.Error); Application.Exit(); } @@ -58,8 +59,8 @@ namespace Flowframes.Os if (!version.ToLower().Contains("windows 10") && !version.ToLower().Contains("windows 11") && !Config.GetBool("ignoreIncompatibleOs", false)) { - MessageBox.Show($"This application was made for Windows 10/11 and is not officially compatible with {version}.\n\n" + - $"Use it at your own risk and do NOT ask for support as long as your are on {version}.", "Warning"); + UiUtils.ShowMessageBox($"This application was made for Windows 10/11 and is not officially compatible with {version}.\n\n" + + $"Use it at your own risk and do NOT ask for support as long as your are on {version}.", UiUtils.MessageType.Warning); } } @@ -77,8 +78,8 @@ namespace Flowframes.Os { if (!silent) { - MessageBox.Show("Flowframes will now enable Windows' Developer Mode which is required for video encoding improvements.\n\n" + - "This requires administrator privileges once.", "Message"); + UiUtils.ShowMessageBox("Flowframes will now enable Windows' Developer Mode which is required for video encoding improvements.\n\n" + + "This requires administrator privileges once.", UiUtils.MessageType.Message); } Logger.Log($"Trying to enable dev mode.", true); @@ -107,9 +108,9 @@ namespace Flowframes.Os { if (!silent) { - MessageBox.Show("Failed to enable developer mode - Perhaps you do not have sufficient privileges.\n\n" + + UiUtils.ShowMessageBox("Failed to enable developer mode - Perhaps you do not have sufficient privileges.\n\n" + "Without Developer Mode, video encoding will be noticably slower.\n\nYou can still try enabling " + - "it manually in the Windows 10 Settings:\nSettings -> Update & security -> For developers -> Developer mode.", "Message"); + "it manually in the Windows 10 Settings:\nSettings -> Update & security -> For developers -> Developer mode.", UiUtils.MessageType.Message); } Logger.Log("Failed to enable dev mode.", true); diff --git a/Code/Os/Updater.cs b/Code/Os/Updater.cs index 8a2430f..6611114 100644 --- a/Code/Os/Updater.cs +++ b/Code/Os/Updater.cs @@ -1,6 +1,7 @@ using Flowframes.Data; using Flowframes.Forms; using Flowframes.IO; +using Flowframes.Ui; using System; using System.IO; using System.Net; @@ -103,7 +104,7 @@ namespace Flowframes.Os } catch (Exception e) { - MessageBox.Show("Error: Failed to download update.\n\n" + e.Message, "Error"); + UiUtils.ShowMessageBox("Error: Failed to download update.\n\n" + e.Message, UiUtils.MessageType.Error); Logger.Log("Updater Error during download: " + e.Message, true); return; } @@ -118,13 +119,13 @@ namespace Flowframes.Os } catch (Exception e) { - MessageBox.Show("Error: Failed to install update.\n\n" + e.Message, "Error"); + UiUtils.ShowMessageBox("Error: Failed to install update.\n\n" + e.Message, UiUtils.MessageType.Error); Logger.Log("Updater Error during install: " + e.Message, true); return; } form.SetProgLabel(101f, $"Update downloaded."); await Task.Delay(20); - MessageBox.Show("Update was installed!\nFlowframes will now close. Restart it to use the new version.", "Message"); + UiUtils.ShowMessageBox("Update was installed!\nFlowframes will now close. Restart it to use the new version."); Application.Exit(); } diff --git a/Code/Ui/MainUiFunctions.cs b/Code/Ui/MainUiFunctions.cs index 3b0e2f7..8030284 100644 --- a/Code/Ui/MainUiFunctions.cs +++ b/Code/Ui/MainUiFunctions.cs @@ -107,7 +107,7 @@ namespace Flowframes.Ui string interpFrames = interpFrmAmount > 2 ? $"{interpFrmAmount} interpolated frames" : "no interpolated frames"; string msg = $"A temporary folder for this video already exists. It contains {scnFrames}, {srcFrames}, {interpFrames}."; - DialogResult dialogResult = MessageBox.Show($"{msg}\n\nClick \"Yes\" to use the existing files or \"No\" to delete them.", "Use files from existing temp folder?", MessageBoxButtons.YesNo); + DialogResult dialogResult = UiUtils.ShowMessageBox($"{msg}\n\nClick \"Yes\" to use the existing files or \"No\" to delete them.", "Use files from existing temp folder?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.No) { IoUtils.TryDeleteIfExists(tmpFolder); diff --git a/Code/Ui/UiUtils.cs b/Code/Ui/UiUtils.cs index 687ef8d..bc824cc 100644 --- a/Code/Ui/UiUtils.cs +++ b/Code/Ui/UiUtils.cs @@ -96,12 +96,17 @@ namespace Flowframes.Ui if (type == MessageType.Warning) icon = MessageBoxIcon.Warning; else if (type == MessageType.Error) icon = MessageBoxIcon.Error; - //DialogResult res = MessageBox.Show(text, $"Flowframes - {type}", MessageBoxButtons.OK, icon, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); MessageForm form = new MessageForm(text, type.ToString()); form.ShowDialog(); return DialogResult.OK; } + public static DialogResult ShowMessageBox(string text, string title, MessageBoxButtons btns) + { + MessageForm form = new MessageForm(text, title, btns); + return form.ShowDialog(); + } + public enum MoveDirection { Up = -1, Down = 1 }; public static void MoveListViewItem(ListView listView, MoveDirection direction)