//===================================================================== /// <summary> /// This is overridden to allow proper comparison of <c>ListPadding</c> objects /// </summary> /// <param name="obj">The object to which this instance is compared</param> /// <returns>Returns true if the object equals this instance, false if it does not</returns> public override bool Equals(object obj) { if (obj == null || !(obj is ListPadding)) { return(false); } ListPadding lp = (ListPadding)obj; return(this.Top == lp.Top && this.Left == lp.Left && this.Bottom == lp.Bottom && this.Right == lp.Right && this.Column == lp.Column && this.Row == lp.Row); }
//===================================================================== /// <summary> /// Constructor /// </summary> /// <remarks>By default, the button list will display all items in the data source in a single column, /// item parts are left aligned and the control will have an etched border. A default selection (item /// zero) is enforced.</remarks> protected BaseButtonList() { checkAlign = imageAlign = textAlign = ContentAlignment.MiddleLeft; appearance = Appearance.Normal; borderStyle = Border3DStyle.Etched; useMnemonic = true; // NOTE: If you change this, change it in the designer methods too! padding = new ListPadding(4, 8, 4, 8, 4, 0); brBackground = new SolidBrush(SystemColors.Control); brTitleBack = new SolidBrush(SystemColors.Control); brTitleFore = new SolidBrush(SystemColors.ControlText); penTitleBorder = new Pen(Color.Black); fontTitle = new Font(Control.DefaultFont, Control.DefaultFont.Style); sfTitle = new StringFormat(); sfTitle.Alignment = StringAlignment.Center; sfTitle.LineAlignment = StringAlignment.Center; this.InitializeComponent(); }