Пример #1
0
 private void _closeButton_VisibleChanged(object sender, EventArgs e)
 {
     _okButton.Text = _model.GetOKButtonText(_closeButton.Visible);
     if (!_closeButton.Visible)
     {
         // if the close button isn't visible, move the Add (OK) button over
         _okButton.Location = new Point(
             _closeButton.Location.X + _closeButton.Size.Width - _okButton.Size.Width,
             _closeButton.Location.Y);
     }
     // No need for an else clause to move the button back, b/c _closeButton.Visible is set only once.
 }