Beispiel #1
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         this.Text = this.EditControl.Text;
         this.EditControl.ValueChanged -= new EventHandler(this.OnValueChanged);
         this.EditControl.Hide();
     }
     base.Hide();
     this.EditControl = null;
 }
Beispiel #2
0
 protected override void Click(int yOffset, int parentWidth)
 {
     if (this.Enabled)
     {
         if (this.EditControl != null)
         {
             this.EditControl.Focus();
             this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
         }
         else
         {
             base.DisableEvents = true;
             DVMaskedTextBox control = base.Parent.GetControl(typeof(DVMaskedTextBox)) as DVMaskedTextBox;
             if (control != null)
             {
                 control.MaskedTextBox.Font     = base.TextFont;
                 control.MaskedTextBox.ReadOnly = this.ReadOnly;
                 if (control.MaskedTextBox.TextAlign != base.TextAlign)
                 {
                     control.MaskedTextBox.TextAlign = base.TextAlign;
                 }
                 control.ItemBorder = base.ItemBorder;
                 control.MaskedTextBox.BorderStyle    = this.Border ? BorderStyle.FixedSingle : BorderStyle.None;
                 control.MaskedTextBox.PasswordChar   = this.PasswordChar;
                 control.MaskedTextBox.BeepOnError    = this.BeepOnError;
                 control.MaskedTextBox.Mask           = this.Mask;
                 control.MaskedTextBox.PromptChar     = this.PromptChar;
                 control.MaskedTextBox.ResetOnPrompt  = this.ResetOnPrompt;
                 control.MaskedTextBox.ResetOnSpace   = this.ResetOnSpace;
                 control.MaskedTextBox.TextMaskFormat = this.TextMaskFormat;
                 this.EditControl = control;
                 this.EditControl.ValueChanged += new EventHandler(this.OnValueChanged);
                 this.EditControl.Bounds        = this.GetActivePartBounds(yOffset);
                 control.MaskedTextBox.Text     = this.Text;
                 base.DisableEvents             = false;
                 this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
                 base.DisableEvents = true;
                 if (this.EditControl != null)
                 {
                     this.EditControl.Show();
                     this.EditControl.Focus();
                 }
             }
             base.DisableEvents = false;
             base.Click(yOffset, parentWidth);
         }
     }
 }
Beispiel #3
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         this.Text = this.EditControl.Text;
         this.EditControl.ValueChanged -= new EventHandler(this.OnValueChanged);
         this.EditControl.Hide();
     }
     base.Hide();
     this.EditControl = null;
 }
Beispiel #4
0
 protected override void Click(int yOffset, int parentWidth)
 {
     if (this.Enabled)
     {
         if (this.EditControl != null)
         {
             this.EditControl.Focus();
             this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
         }
         else
         {
             base.DisableEvents = true;
             DVMaskedTextBox control = base.Parent.GetControl(typeof(DVMaskedTextBox)) as DVMaskedTextBox;
             if (control != null)
             {
                 control.MaskedTextBox.Font = base.TextFont;
                 control.MaskedTextBox.ReadOnly = this.ReadOnly;
                 if (control.MaskedTextBox.TextAlign != base.TextAlign)
                 {
                     control.MaskedTextBox.TextAlign = base.TextAlign;
                 }
                 control.ItemBorder = base.ItemBorder;
                 control.MaskedTextBox.BorderStyle = this.Border ? BorderStyle.FixedSingle : BorderStyle.None;
                 control.MaskedTextBox.PasswordChar = this.PasswordChar;
                 control.MaskedTextBox.BeepOnError = this.BeepOnError;
                 control.MaskedTextBox.Mask = this.Mask;
                 control.MaskedTextBox.PromptChar = this.PromptChar;
                 control.MaskedTextBox.ResetOnPrompt = this.ResetOnPrompt;
                 control.MaskedTextBox.ResetOnSpace = this.ResetOnSpace;
                 control.MaskedTextBox.TextMaskFormat = this.TextMaskFormat;
                 this.EditControl = control;
                 this.EditControl.ValueChanged += new EventHandler(this.OnValueChanged);
                 this.EditControl.Bounds = this.GetActivePartBounds(yOffset);
                 control.MaskedTextBox.Text = this.Text;
                 base.DisableEvents = false;
                 this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
                 base.DisableEvents = true;
                 if (this.EditControl != null)
                 {
                     this.EditControl.Show();
                     this.EditControl.Focus();
                 }
             }
             base.DisableEvents = false;
             base.Click(yOffset, parentWidth);
         }
     }
 }