Fix MaxSize of input boxes

This commit is contained in:
SupSuper 2018-04-16 00:40:58 +01:00
parent 48402c740b
commit c60467ee3b
2 changed files with 11 additions and 14 deletions

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ShareX.HelpersLib
@ -48,6 +49,8 @@ public InputBox(string title = null, string inputText = null, string okText = nu
private void InputBox_Shown(object sender, EventArgs e)
{
this.ForceActivate();
this.MinimumSize = new Size(384, this.Size.Height);
this.MaximumSize = new Size(1000, this.Size.Height);
txtInputText.SelectionLength = txtInputText.Text.Length;
}
@ -99,28 +102,28 @@ private void InitializeComponent()
this.btnCancel = new System.Windows.Forms.Button();
this.txtInputText = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
//
// btnOK
//
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
//
// btnCancel
//
//
resources.ApplyResources(this.btnCancel, "btnCancel");
this.btnCancel.Name = "btnCancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
//
// txtInputText
//
//
resources.ApplyResources(this.txtInputText, "txtInputText");
this.txtInputText.Name = "txtInputText";
//
//
// InputBox
//
//
this.AcceptButton = this.btnOK;
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

View file

@ -207,12 +207,6 @@
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>484, 63</value>
</data>
<data name="$this.MaximumSize" type="System.Drawing.Size, System.Drawing">
<value>1000, 102</value>
</data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>384, 102</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>