private void InitializeControls() { Cleanup(); base.BackColor = SystemColors.Window; _backColorChanged = false; for (int index = 0; index < FieldCount; ++index) { FieldControl fc = new FieldControl(); fc.CreateControl(); fc.FieldIndex = index; fc.Name = NTNN.Properties.Resources.FieldControlName + index.ToString(CultureInfo.InvariantCulture); fc.Parent = this; fc.ReadOnly = ReadOnly; fc.CedeFocusEvent += new EventHandler <CedeFocusEventArgs>(OnFocusCeded); fc.FieldChangedEvent += new EventHandler <FieldChangedEventArgs>(OnFieldChanged); fc.GotFocus += new EventHandler(OnFieldGotFocus); fc.KeyDown += new KeyEventHandler(OnFieldKeyDown); fc.KeyPress += new KeyPressEventHandler(OnFieldKeyPressed); fc.KeyUp += new KeyEventHandler(OnFieldKeyUp); fc.LostFocus += new EventHandler(OnFieldLostFocus); fc.PreviewKeyDown += new PreviewKeyDownEventHandler(OnFieldPreviewKeyDown); fc.FieldSizeChangedEvent += new EventHandler(OnFieldSizeChanged); fc.FieldValidatedEvent += new EventHandler <FieldValidatedEventArgs>(OnFieldValidated); fc.Click += new EventHandler(OnSubControlClicked); fc.DoubleClick += new EventHandler(OnSubControlDoubleClicked); fc.MouseClick += new MouseEventHandler(OnSubControlMouseClicked); fc.MouseDoubleClick += new MouseEventHandler(OnSubControlMouseDoubleClicked); fc.MouseEnter += new EventHandler(OnSubControlMouseEntered); fc.MouseHover += new EventHandler(OnSubControlMouseHovered); fc.MouseLeave += new EventHandler(OnSubControlMouseLeft); fc.MouseMove += new MouseEventHandler(OnSubControlMouseMoved); fc.PasteEvent += new EventHandler <PasteEventArgs>(OnPaste); _fieldControls.Add(fc); Controls.Add(fc); } for (int index = 0; index < (FieldCount + 1); ++index) { SeparatorControl sc = new SeparatorControl(); sc.CreateControl(); sc.Name = NTNN.Properties.Resources.SeparatorControlName + index.ToString(CultureInfo.InvariantCulture); sc.Parent = this; sc.ReadOnly = ReadOnly; sc.SeparatorIndex = index; sc.SeparatorMouseEvent += new EventHandler <SeparatorMouseEventArgs>(OnSeparatorMouseEvent); sc.SeparatorSizeChangedEvent += new EventHandler <EventArgs>(OnSeparatorSizeChanged); sc.Click += new EventHandler(OnSubControlClicked); sc.DoubleClick += new EventHandler(OnSubControlDoubleClicked); sc.MouseClick += new MouseEventHandler(OnSubControlMouseClicked); sc.MouseDoubleClick += new MouseEventHandler(OnSubControlMouseDoubleClicked); sc.MouseEnter += new EventHandler(OnSubControlMouseEntered); sc.MouseHover += new EventHandler(OnSubControlMouseHovered); sc.MouseLeave += new EventHandler(OnSubControlMouseLeft); sc.MouseMove += new MouseEventHandler(OnSubControlMouseMoved); _separatorControls.Add(sc); Controls.Add(sc); } for (int index = 0; index < _separatorControls.Count; ++index) { string text; if (index == 0) { text = NTNN.Properties.Resources.NearText; } else if (index == (_separatorControls.Count - 1)) { text = NTNN.Properties.Resources.FarText; } else { text = NTNN.Properties.Resources.MiddleText; } _separatorControls[index].Text = text; } }
private void InitializeControls() { Cleanup(); base.BackColor = SystemColors.Window; _backColorChanged = false; for (int index = 0; index < FieldCount; ++index) { FieldControl fc = new FieldControl(); fc.CedeFocusEvent += new EventHandler <CedeFocusEventArgs>(OnFocusCeded); fc.FieldChangedEvent += new EventHandler <FieldChangedEventArgs>(OnFieldChanged); fc.FieldFocusEvent += new EventHandler <FieldFocusEventArgs>(OnFieldFocus); fc.FieldIndex = index; fc.FieldKeyPressedEvent += new KeyPressEventHandler(OnFieldKeyPressed); fc.FieldSizeChangedEvent += new EventHandler <EventArgs>(OnFieldSizeChanged); fc.FieldValidatedEvent += new EventHandler <FieldValidatedEventArgs>(OnFieldValidated); fc.Name = "FieldControl" + index.ToString(CultureInfo.InvariantCulture); fc.Parent = this; fc.ReadOnly = ReadOnly; _fieldControls.Add(fc); Controls.Add(fc); } for (int index = 0; index < (FieldCount + 1); ++index) { SeparatorControl sc = new SeparatorControl(); sc.Name = "SeparatorControl" + index.ToString(CultureInfo.InvariantCulture); sc.Parent = this; sc.ReadOnly = ReadOnly; sc.SeparatorIndex = index; sc.SeparatorMouseEvent += new EventHandler <SeparatorMouseEventArgs>(OnSeparatorMouseEvent); sc.SeparatorSizeChangedEvent += new EventHandler <EventArgs>(OnSeparatorSizeChanged); _separatorControls.Add(sc); Controls.Add(sc); } for (int index = 0; index < _separatorControls.Count; ++index) { string text; if (index == 0) { text = "<"; } else if (index == (_separatorControls.Count - 1)) { text = ">"; } else { text = "><"; } _separatorControls[index].Text = text; } }
private void InitializeControls() { Cleanup(); base.BackColor = SystemColors.Window; _backColorChanged = false; for ( int index = 0; index < FieldCount; ++index ) { FieldControl fc = new FieldControl(); fc.CreateControl(); fc.FieldIndex = index; fc.Name = Properties.Resources.FieldControlName + index.ToString( CultureInfo.InvariantCulture ); fc.Parent = this; fc.ReadOnly = ReadOnly; fc.CedeFocusEvent += new EventHandler<CedeFocusEventArgs>( OnFocusCeded ); fc.FieldChangedEvent += new EventHandler<FieldChangedEventArgs>( OnFieldChanged ); fc.GotFocus += new EventHandler( OnFieldGotFocus ); fc.KeyDown += new KeyEventHandler( OnFieldKeyDown ); fc.KeyPress += new KeyPressEventHandler( OnFieldKeyPressed ); fc.KeyUp += new KeyEventHandler( OnFieldKeyUp ); fc.LostFocus += new EventHandler( OnFieldLostFocus ); fc.PreviewKeyDown += new PreviewKeyDownEventHandler( OnFieldPreviewKeyDown ); fc.FieldSizeChangedEvent += new EventHandler( OnFieldSizeChanged ); fc.FieldValidatedEvent += new EventHandler<FieldValidatedEventArgs>( OnFieldValidated ); fc.Click += new EventHandler( OnSubControlClicked ); fc.DoubleClick += new EventHandler( OnSubControlDoubleClicked ); fc.MouseClick += new MouseEventHandler( OnSubControlMouseClicked ); fc.MouseDoubleClick += new MouseEventHandler( OnSubControlMouseDoubleClicked ); fc.MouseEnter += new EventHandler( OnSubControlMouseEntered ); fc.MouseHover += new EventHandler( OnSubControlMouseHovered ); fc.MouseLeave += new EventHandler( OnSubControlMouseLeft ); fc.MouseMove += new MouseEventHandler( OnSubControlMouseMoved ); _fieldControls.Add( fc ); Controls.Add( fc ); } for ( int index = 0; index < ( FieldCount + 1 ); ++index ) { SeparatorControl sc = new SeparatorControl(); sc.CreateControl(); sc.Name = Properties.Resources.SeparatorControlName + index.ToString( CultureInfo.InvariantCulture ); sc.Parent = this; sc.ReadOnly = ReadOnly; sc.SeparatorIndex = index; sc.SeparatorMouseEvent += new EventHandler<SeparatorMouseEventArgs>( OnSeparatorMouseEvent ); sc.SeparatorSizeChangedEvent += new EventHandler<EventArgs>( OnSeparatorSizeChanged ); sc.Click += new EventHandler( OnSubControlClicked ); sc.DoubleClick += new EventHandler( OnSubControlDoubleClicked ); sc.MouseClick += new MouseEventHandler( OnSubControlMouseClicked ); sc.MouseDoubleClick += new MouseEventHandler( OnSubControlMouseDoubleClicked ); sc.MouseEnter += new EventHandler( OnSubControlMouseEntered ); sc.MouseHover += new EventHandler( OnSubControlMouseHovered ); sc.MouseLeave += new EventHandler( OnSubControlMouseLeft ); sc.MouseMove += new MouseEventHandler( OnSubControlMouseMoved ); _separatorControls.Add( sc ); Controls.Add( sc ); } for ( int index = 0; index < _separatorControls.Count; ++index ) { string text; if ( index == 0 ) { text = "<"; } else if ( index == ( _separatorControls.Count - 1 ) ) { text = ">"; } else { text = "><"; } _separatorControls[ index ].Text = text; } }
private void InitializeControls() { Cleanup(); base.BackColor = SystemColors.Window; _backColorChanged = false; for ( int index = 0; index < FieldCount; ++index ) { FieldControl fc = new FieldControl(); fc.CedeFocusEvent += new EventHandler<CedeFocusEventArgs>( OnFocusCeded ); fc.FieldChangedEvent += new EventHandler<FieldChangedEventArgs>( OnFieldChanged ); fc.FieldFocusEvent += new EventHandler<FieldFocusEventArgs>( OnFieldFocus ); fc.FieldIndex = index; fc.FieldKeyPressedEvent += new KeyPressEventHandler( OnFieldKeyPressed ); fc.FieldSizeChangedEvent += new EventHandler<EventArgs>( OnFieldSizeChanged ); fc.FieldValidatedEvent += new EventHandler<FieldValidatedEventArgs>( OnFieldValidated ); fc.Name = "FieldControl" + index.ToString(CultureInfo.InvariantCulture); fc.Parent = this; fc.ReadOnly = ReadOnly; _fieldControls.Add( fc ); Controls.Add( fc ); } for ( int index = 0; index < ( FieldCount + 1 ); ++index ) { SeparatorControl sc = new SeparatorControl(); sc.Name = "SeparatorControl" + index.ToString( CultureInfo.InvariantCulture ); sc.Parent = this; sc.ReadOnly = ReadOnly; sc.SeparatorIndex = index; sc.SeparatorMouseEvent += new EventHandler<SeparatorMouseEventArgs>( OnSeparatorMouseEvent ); sc.SeparatorSizeChangedEvent += new EventHandler<EventArgs>( OnSeparatorSizeChanged ); _separatorControls.Add( sc ); Controls.Add( sc ); } for ( int index = 0; index < _separatorControls.Count; ++index ) { string text; if ( index == 0 ) { text = "<"; } else if ( index == ( _separatorControls.Count - 1 ) ) { text = ">"; } else { text = "><"; } _separatorControls[index].Text = text; } }