Add escape to cancel range min/max change, commit change on focus loss

This commit is contained in:
baldurk
2015-07-15 18:53:31 +02:00
parent d6abdb2d2e
commit 4a3894a187
3 changed files with 58 additions and 17 deletions
@@ -33,8 +33,13 @@ namespace renderdocui.Controls
// http://msdn.microsoft.com/en-us/library/ms404304(v=vs.90).aspx
public class ToolStripSpringTextBox : ToolStripTextBox
{
public bool ResizeToFit = true;
public override Size GetPreferredSize(Size constrainingSize)
{
if (!ResizeToFit)
return base.GetPreferredSize(constrainingSize);
// Use the default size if the text box is on the overflow menu
// or is on a vertical ToolStrip.
if (IsOnOverflow || Owner.Orientation == Orientation.Vertical)