Exemplo n.º 1
0
        public IPAddressControl()
        {
            BackColor = SystemColors.Window;

            ResetBackColorChanged();

            for (int index = 0; index < _fieldControls.Length; ++index)
            {
                _fieldControls[index] = new FieldControl();

                _fieldControls[index].CedeFocusEvent   += new EventHandler <CedeFocusEventArgs>(this.OnCedeFocus);
                _fieldControls[index].FieldId           = index;
                _fieldControls[index].Name              = "FieldControl" + index.ToString(CultureInfo.InvariantCulture);
                _fieldControls[index].Parent            = this;
                _fieldControls[index].SpecialKeyEvent  += new EventHandler <SpecialKeyEventArgs>(this.OnSpecialKey);
                _fieldControls[index].TextChangedEvent += new EventHandler <TextChangedEventArgs>(this.OnFieldTextChanged);

                Controls.Add(_fieldControls[index]);

                if (index < (NumberOfFields - 1))
                {
                    _dotControls[index] = new DotControl();

                    _dotControls[index].Name   = "DotControl" + index.ToString(CultureInfo.InvariantCulture);
                    _dotControls[index].Parent = this;

                    Controls.Add(_dotControls[index]);
                }
            }

            InitializeComponent();

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.ContainerControl, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.Selectable, true);
            SetStyle(ControlStyles.UserPaint, true);

            _referenceTextBox.AutoSize = true;

            Size     = MinimumSize;
            AutoSize = true;

            DragEnter += new DragEventHandler(IPAddressControl_DragEnter);
            DragDrop  += new DragEventHandler(IPAddressControl_DragDrop);
        }
        public IPAddressControl()
        {
            BackColor = SystemColors.Window;

            ResetBackColorChanged();

            for (int index = 0; index < _fieldControls.Length; ++index)
            {
                _fieldControls[index] = new FieldControl();

                _fieldControls[index].CreateControl();

                _fieldControls[index].FieldIndex = index;
                _fieldControls[index].Name       = "FieldControl" + index.ToString(CultureInfo.InvariantCulture);
                _fieldControls[index].Parent     = this;

                _fieldControls[index].CedeFocusEvent   += new EventHandler <CedeFocusEventArgs>(OnCedeFocus);
                _fieldControls[index].Click            += new EventHandler(OnSubControlClicked);
                _fieldControls[index].DoubleClick      += new EventHandler(OnSubControlDoubleClicked);
                _fieldControls[index].GotFocus         += new EventHandler(OnFieldGotFocus);
                _fieldControls[index].KeyDown          += new KeyEventHandler(OnFieldKeyDown);
                _fieldControls[index].KeyPress         += new KeyPressEventHandler(OnFieldKeyPressed);
                _fieldControls[index].KeyUp            += new KeyEventHandler(OnFieldKeyUp);
                _fieldControls[index].LostFocus        += new EventHandler(OnFieldLostFocus);
                _fieldControls[index].MouseClick       += new MouseEventHandler(OnSubControlMouseClicked);
                _fieldControls[index].MouseDoubleClick += new MouseEventHandler(OnSubControlMouseDoubleClicked);
                _fieldControls[index].MouseEnter       += new EventHandler(OnSubControlMouseEntered);
                _fieldControls[index].MouseHover       += new EventHandler(OnSubControlMouseHovered);
                _fieldControls[index].MouseLeave       += new EventHandler(OnSubControlMouseLeft);
                _fieldControls[index].MouseMove        += new MouseEventHandler(OnSubControlMouseMoved);
                _fieldControls[index].PasteEvent       += new EventHandler <PasteEventArgs>(OnPaste);
                _fieldControls[index].PreviewKeyDown   += new PreviewKeyDownEventHandler(OnFieldPreviewKeyDown);
                _fieldControls[index].TextChangedEvent += new EventHandler <TextChangedEventArgs>(OnFieldTextChanged);

                Controls.Add(_fieldControls[index]);

                if (index < (FieldCount - 1))
                {
                    _dotControls[index] = new DotControl();

                    _dotControls[index].CreateControl();

                    _dotControls[index].Name   = "DotControl" + index.ToString(CultureInfo.InvariantCulture);
                    _dotControls[index].Parent = this;

                    _dotControls[index].Click            += new EventHandler(OnSubControlClicked);
                    _dotControls[index].DoubleClick      += new EventHandler(OnSubControlDoubleClicked);
                    _dotControls[index].MouseClick       += new MouseEventHandler(OnSubControlMouseClicked);
                    _dotControls[index].MouseDoubleClick += new MouseEventHandler(OnSubControlMouseDoubleClicked);
                    _dotControls[index].MouseEnter       += new EventHandler(OnSubControlMouseEntered);
                    _dotControls[index].MouseHover       += new EventHandler(OnSubControlMouseHovered);
                    _dotControls[index].MouseLeave       += new EventHandler(OnSubControlMouseLeft);
                    _dotControls[index].MouseMove        += new MouseEventHandler(OnSubControlMouseMoved);

                    Controls.Add(_dotControls[index]);
                }
            }

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.ContainerControl, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.FixedWidth, true);
            SetStyle(ControlStyles.FixedHeight, true);

            Cursor = Cursors.IBeam;

            AutoScaleDimensions = new SizeF(96F, 96F);
            AutoScaleMode       = AutoScaleMode.Dpi;

            Size = MinimumSize;

            DragEnter += new DragEventHandler(IPAddressControl_DragEnter);
            DragDrop  += new DragEventHandler(IPAddressControl_DragDrop);
        }
Exemplo n.º 3
0
        public IPAddressControl()
        {
            BackColor = SystemColors.Window;

             ResetBackColorChanged();

             for ( int index = 0; index < _fieldControls.Length; ++index )
             {
            _fieldControls[index] = new FieldControl();

            _fieldControls[index].CreateControl();

            _fieldControls[index].FieldIndex = index;
            _fieldControls[index].Name = "FieldControl" + index.ToString( CultureInfo.InvariantCulture );
            _fieldControls[index].Parent = this;

            _fieldControls[index].CedeFocusEvent += new EventHandler<CedeFocusEventArgs>( OnCedeFocus );
            _fieldControls[index].Click += new EventHandler( OnSubControlClicked );
            _fieldControls[index].DoubleClick += new EventHandler( OnSubControlDoubleClicked );
            _fieldControls[index].GotFocus += new EventHandler( OnFieldGotFocus );
            _fieldControls[index].KeyDown += new KeyEventHandler( OnFieldKeyDown );
            _fieldControls[index].KeyPress += new KeyPressEventHandler( OnFieldKeyPressed );
            _fieldControls[index].KeyUp += new KeyEventHandler( OnFieldKeyUp );
            _fieldControls[index].LostFocus += new EventHandler( OnFieldLostFocus );
            _fieldControls[index].MouseClick += new MouseEventHandler( OnSubControlMouseClicked );
            _fieldControls[index].MouseDoubleClick += new MouseEventHandler( OnSubControlMouseDoubleClicked );
            _fieldControls[index].MouseEnter += new EventHandler( OnSubControlMouseEntered );
            _fieldControls[index].MouseHover += new EventHandler( OnSubControlMouseHovered );
            _fieldControls[index].MouseLeave += new EventHandler( OnSubControlMouseLeft );
            _fieldControls[index].MouseMove += new MouseEventHandler( OnSubControlMouseMoved );
            _fieldControls[index].PreviewKeyDown += new PreviewKeyDownEventHandler( OnFieldPreviewKeyDown );
            _fieldControls[index].TextChangedEvent += new EventHandler<TextChangedEventArgs>( OnFieldTextChanged );

            Controls.Add( _fieldControls[index] );

            if ( index < ( FieldCount - 1 ) )
            {
               _dotControls[index] = new DotControl();

               _dotControls[index].CreateControl();

               _dotControls[index].Name = "DotControl" + index.ToString( CultureInfo.InvariantCulture );
               _dotControls[index].Parent = this;

               _dotControls[index].Click += new EventHandler( OnSubControlClicked );
               _dotControls[index].DoubleClick += new EventHandler( OnSubControlDoubleClicked );
               _dotControls[index].MouseClick += new MouseEventHandler( OnSubControlMouseClicked );
               _dotControls[index].MouseDoubleClick += new MouseEventHandler( OnSubControlMouseDoubleClicked );
               _dotControls[index].MouseEnter += new EventHandler( OnSubControlMouseEntered );
               _dotControls[index].MouseHover += new EventHandler( OnSubControlMouseHovered );
               _dotControls[index].MouseLeave += new EventHandler( OnSubControlMouseLeft );
               _dotControls[index].MouseMove += new MouseEventHandler( OnSubControlMouseMoved );

               Controls.Add( _dotControls[index] );
            }
             }

             SetStyle( ControlStyles.AllPaintingInWmPaint, true );
             SetStyle( ControlStyles.ContainerControl, true );
             SetStyle( ControlStyles.OptimizedDoubleBuffer, true );
             SetStyle( ControlStyles.ResizeRedraw, true );
             SetStyle( ControlStyles.UserPaint, true );

             _referenceTextBox.AutoSize = true;

             Cursor = Cursors.IBeam;

             Size = MinimumSize;

             DragEnter += new DragEventHandler( IPAddressControl_DragEnter );
             DragDrop += new DragEventHandler( IPAddressControl_DragDrop );
        }
Exemplo n.º 4
0
        public IPAddressControl()
        {
            BackColor = Color.FromKnownColor( KnownColor.Window );

            for ( int index = 0; index < _fieldControls.Length; ++index )
             {
            _fieldControls[index] = new FieldControl();

            _fieldControls[index].CreateControl();

            _fieldControls[index].Name = "fieldControl" + index.ToString( CultureInfo.InvariantCulture );
            _fieldControls[index].Parent = this;
            _fieldControls[index].FieldIndex = index;

            _fieldControls[index].CedeFocusEvent += new CedeFocusHandler( OnCedeFocus );
            _fieldControls[index].Click += new EventHandler( OnSubControlClicked );
            _fieldControls[index].DoubleClick += new EventHandler( OnSubControlDoubleClicked );
            _fieldControls[index].GotFocus += new EventHandler( OnFieldGotFocus );
            _fieldControls[index].KeyDown += new KeyEventHandler( OnFieldKeyDown );
            _fieldControls[index].KeyPress += new KeyPressEventHandler( OnFieldKeyPressed );
            _fieldControls[index].KeyUp += new KeyEventHandler( OnFieldKeyUp );
            _fieldControls[index].LostFocus += new EventHandler( OnFieldLostFocus );
            _fieldControls[index].MouseEnter += new EventHandler( OnSubControlMouseEntered );
            _fieldControls[index].MouseHover += new EventHandler( OnSubControlMouseHovered );
            _fieldControls[index].MouseLeave += new EventHandler( OnSubControlMouseLeft );
            _fieldControls[index].MouseMove += new MouseEventHandler( OnSubControlMouseMoved );
            _fieldControls[index].TextChangedEvent += new TextChangedHandler( OnFieldTextChanged );

            Controls.Add( _fieldControls[index] );
             }

             for ( int index = 0; index < _dotControls.Length; ++index )
             {
            _dotControls[index] = new DotControl();

            _dotControls[index].CreateControl();

            _dotControls[index].Name = "dotControl" + index.ToString( CultureInfo.InvariantCulture );
            _dotControls[index].Parent = this;
            _dotControls[index].IgnoreTheme = ( BorderStyle != BorderStyle.Fixed3D );

            _dotControls[index].Click += new EventHandler( OnSubControlClicked );
            _dotControls[index].DoubleClick += new EventHandler( OnSubControlDoubleClicked );
            _dotControls[index].MouseEnter += new EventHandler( OnSubControlMouseEntered );
            _dotControls[index].MouseHover += new EventHandler( OnSubControlMouseHovered );
            _dotControls[index].MouseLeave += new EventHandler( OnSubControlMouseLeft );
            _dotControls[index].MouseMove += new MouseEventHandler( OnSubControlMouseMoved );

            Controls.Add( _dotControls[index] );
             }

             Cursor = Cursors.IBeam;
             Size = MinimumSize;

             SetStyle( ControlStyles.AllPaintingInWmPaint, true );
             SetStyle( ControlStyles.ContainerControl, true );
             SetStyle( ControlStyles.DoubleBuffer, true );
             SetStyle( ControlStyles.ResizeRedraw, true );
             SetStyle( ControlStyles.UserPaint, true );

             LayoutControls();
        }
Exemplo n.º 5
0
      public IPAddressControl()
      {
         BackColor = SystemColors.Window;

         ResetBackColorChanged();

         for ( int index = 0; index < _fieldControls.Length; ++index )
         {
            _fieldControls[index] = new FieldControl();

            _fieldControls[index].CedeFocusEvent += new EventHandler<CedeFocusEventArgs>( this.OnCedeFocus );
            _fieldControls[index].FieldId = index;
            _fieldControls[index].Name = "FieldControl" + index.ToString( CultureInfo.InvariantCulture );
            _fieldControls[index].Parent = this;
            _fieldControls[index].SpecialKeyEvent += new EventHandler<SpecialKeyEventArgs>( this.OnSpecialKey );
            _fieldControls[index].TextChangedEvent += new EventHandler<TextChangedEventArgs>( this.OnFieldTextChanged );

            Controls.Add( _fieldControls[index] );

            if ( index < ( NumberOfFields - 1 ) )
            {
               _dotControls[index] = new DotControl();

               _dotControls[index].Name = "DotControl" + index.ToString( CultureInfo.InvariantCulture );
               _dotControls[index].Parent = this;

               Controls.Add( _dotControls[index] );
            }
         }

         InitializeComponent();

         SetStyle( ControlStyles.AllPaintingInWmPaint, true );
         SetStyle( ControlStyles.ContainerControl, true );
         SetStyle( ControlStyles.OptimizedDoubleBuffer, true );
         SetStyle( ControlStyles.ResizeRedraw, true );
         SetStyle( ControlStyles.Selectable, true );
         SetStyle( ControlStyles.UserPaint, true );

         _referenceTextBox.AutoSize = true;

         Size = MinimumSize;
         AutoSize = true;

         DragEnter += new DragEventHandler( IPAddressControl_DragEnter );
         DragDrop += new DragEventHandler( IPAddressControl_DragDrop );
      }
Exemplo n.º 6
0
        public IPAddressControl()
        {
            BackColor = Color.FromKnownColor(KnownColor.Window);

            for (int index = 0; index < _fieldControls.Length; ++index)
            {
                _fieldControls[index] = new FieldControl();

                _fieldControls[index].CreateControl();

                _fieldControls[index].Name       = "fieldControl" + index.ToString(CultureInfo.InvariantCulture);
                _fieldControls[index].Parent     = this;
                _fieldControls[index].FieldIndex = index;

                _fieldControls[index].CedeFocusEvent   += new CedeFocusHandler(OnCedeFocus);
                _fieldControls[index].Click            += new EventHandler(OnSubControlClicked);
                _fieldControls[index].DoubleClick      += new EventHandler(OnSubControlDoubleClicked);
                _fieldControls[index].GotFocus         += new EventHandler(OnFieldGotFocus);
                _fieldControls[index].KeyDown          += new KeyEventHandler(OnFieldKeyDown);
                _fieldControls[index].KeyPress         += new KeyPressEventHandler(OnFieldKeyPressed);
                _fieldControls[index].KeyUp            += new KeyEventHandler(OnFieldKeyUp);
                _fieldControls[index].LostFocus        += new EventHandler(OnFieldLostFocus);
                _fieldControls[index].MouseEnter       += new EventHandler(OnSubControlMouseEntered);
                _fieldControls[index].MouseHover       += new EventHandler(OnSubControlMouseHovered);
                _fieldControls[index].MouseLeave       += new EventHandler(OnSubControlMouseLeft);
                _fieldControls[index].MouseMove        += new MouseEventHandler(OnSubControlMouseMoved);
                _fieldControls[index].TextChangedEvent += new TextChangedHandler(OnFieldTextChanged);

                Controls.Add(_fieldControls[index]);
            }

            for (int index = 0; index < _dotControls.Length; ++index)
            {
                _dotControls[index] = new DotControl();

                _dotControls[index].CreateControl();

                _dotControls[index].Name        = "dotControl" + index.ToString(CultureInfo.InvariantCulture);
                _dotControls[index].Parent      = this;
                _dotControls[index].IgnoreTheme = (BorderStyle != BorderStyle.Fixed3D);

                _dotControls[index].Click       += new EventHandler(OnSubControlClicked);
                _dotControls[index].DoubleClick += new EventHandler(OnSubControlDoubleClicked);
                _dotControls[index].MouseEnter  += new EventHandler(OnSubControlMouseEntered);
                _dotControls[index].MouseHover  += new EventHandler(OnSubControlMouseHovered);
                _dotControls[index].MouseLeave  += new EventHandler(OnSubControlMouseLeft);
                _dotControls[index].MouseMove   += new MouseEventHandler(OnSubControlMouseMoved);

                Controls.Add(_dotControls[index]);
            }

            Cursor = Cursors.IBeam;
            Size   = MinimumSize;

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.ContainerControl, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);

            LayoutControls();
        }