Пример #1
0
        public void TakeFocus(IPAddressControlAction ipAddressControlAction)
        {
            this.Focus();

            switch (ipAddressControlAction)
            {
            case IPAddressControlAction.Trim:

                if (this.TextLength > 0)
                {
                    int newLength = this.TextLength - 1;
                    base.Text = this.Text.Substring(0, newLength);
                }

                this.SelectionStart = this.TextLength;

                return;

            case IPAddressControlAction.Home:

                this.SelectionStart  = 0;
                this.SelectionLength = 0;

                return;

            case IPAddressControlAction.End:

                this.SelectionStart = this.TextLength;

                return;
            }
        }
Пример #2
0
 private void SendCedeFocusEvent(IPAddressControlAction ipAddressControlAction)
 {
     if (null != CedeFocusEvent)
     {
         CedeFocusEventArgs args = new CedeFocusEventArgs();
         args.FieldIndex             = FieldIndex;
         args.IPAddressControlAction = ipAddressControlAction;
         CedeFocusEvent(this, args);
     }
 }
Пример #3
0
 private void SendCedeFocusEvent(IPAddressControlAction ipAddressControlAction)
 {
     if (null != this.CedeFocusEvent)
     {
         CedeFocusEventArgs args = new CedeFocusEventArgs
         {
             FieldIndex             = this.FieldIndex,
             IPAddressControlAction = ipAddressControlAction
         };
         this.CedeFocusEvent(this, args);
     }
 }
 private void SendCedeFocusEvent(IPAddressControlAction ipAddressControlAction)
 {
     if (null != CedeFocusEvent)
     {
         CedeFocusEventArgs args = new CedeFocusEventArgs();
         args.FieldIndex = FieldIndex;
         args.IPAddressControlAction = ipAddressControlAction;
         CedeFocusEvent(this, args);
     }
 }
        public void TakeFocus(IPAddressControlAction ipAddressControlAction)
        {
            Focus();

            switch (ipAddressControlAction)
            {
                case IPAddressControlAction.Trim:

                    if (TextLength > 0)
                    {
                        int newLength = TextLength - 1;
                        base.Text = Text.Substring(0, newLength);
                    }

                    SelectionStart = TextLength;

                    return;

                case IPAddressControlAction.Home:

                    SelectionStart = 0;
                    SelectionLength = 0;

                    return;

                case IPAddressControlAction.End:

                    SelectionStart = TextLength;

                    return;
            }
        }
Пример #6
0
 private void SendCedeFocusEvent(IPAddressControlAction ipAddressControlAction)
 {
     if (null != this.CedeFocusEvent)
     {
         CedeFocusEventArgs args = new CedeFocusEventArgs
                                       {
                                           FieldIndex = this.FieldIndex,
                                           IPAddressControlAction = ipAddressControlAction
                                       };
         this.CedeFocusEvent(this, args);
     }
 }