AskYesNoForm, AskYesNoOp, MessageBoxForm and MessageBoxOp fixed, bug was introduced when measuring the string length.

This commit is contained in:
Milan Hanajik
2017-03-09 15:24:10 +01:00
parent e93a817d4d
commit 56f8d64fc8
4 changed files with 7 additions and 13 deletions
@@ -10,19 +10,17 @@ namespace TBF.BenchControl.Operations
{
public partial class MessageBoxForm : Form, GenericDevices.IHasCompleted
{
public string Message;
/// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
public MessageBoxForm()
public MessageBoxForm(string message)
{
InitializeComponent();
Localize();
messageLabel.Text = Message;
messageLabel.Text = message;
float textWidth = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(messageLabel.Text, messageLabel.Font).Width;
int rqrdFormWidth = (int)textWidth + 80; /// Form width calculated from the text width