Skip to Content
.NET Windows Forms in a Nutshell
book

.NET Windows Forms in a Nutshell

by Ian Griffiths, Matthew Adams
March 2003
Intermediate to advanced
896 pages
32h 35m
English
O'Reilly Media, Inc.
Content preview from .NET Windows Forms in a Nutshell

Name

ButtonBase

Synopsis

This Control is the base class for the various button-like controls supported by the .NET Framework, including Button (a pushbutton), CheckBox, and RadioButton.

In addition to the standard control features, it provides support for an Image (which can then be positioned in the control using the ImageAlign property) and for alignment of the text (using the TextAlign property).

Note that the default FlatStyle for this class supports .NET features such as images, font, and color changes, but does not support Windows XP themes. You must set the FlatStyle to System in this case, but you will lose the .NET features.


public abstract class ButtonBase : Control {

// Protected Constructors

   protected ButtonBase();

// Public Instance Properties

   public FlatStyle FlatStyle{set; get; }

   public Image Image{set; get; }

   public ContentAlignment ImageAlign{set; get; }

   public int ImageIndex{set; get; }

   public ImageList ImageList{set; get; }

   public ImeMode ImeMode{set; get; } // overrides Control

   public virtual ContentAlignment TextAlign{set; get; }

// Protected Instance Properties

   protected override CreateParams CreateParams{get; } // overrides Control

   protected override ImeMode DefaultImeMode{get; } // overrides Control

   protected override Size DefaultSize{get; } // overrides Control

   protected bool IsDefault{set; get; }

// Protected Instance Methods

   protected override AccessibleObject CreateAccessibilityInstance();  // overrides Control

   protected override void Dispose(bool disposing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms 2.0 Programming

Windows Forms 2.0 Programming

Chris Sells, Michael Weinhardt
Pro C# 7: With .NET and .NET Core

Pro C# 7: With .NET and .NET Core

Andrew Troelsen, Philip Japikse

Publisher Resources

ISBN: 0596003382Supplemental ContentCatalog PageErrata