ToolBarButton

ToolBarButton marshal by reference, disposable

System. Windows .Forms (system. windows .forms.dll) class

This component represents a button on a ToolBar .

By default, the Style is a regular ToolBarButtonStyle.PushButton , but you can change this to a ToolBarButtonStyle.DropDownButton (displaying a menu or pop-up window when clicked), ToolBarButtonStyle.ToggleButton , or ToolBarButtonStyle.Separator (dividing line between the controls).

You can define the Text it will display and the ImageIndex of an image in the Parent controls ToolBar.ImageList . Note that the position in which the text will be displayed on the button is determined by the ToolBar , not the ToolBarButton

It can be enabled and disabled with the Enabled property, and you can change the Visible state. Toggle buttons can be set Pushed (or a tristate -like PartialPush ). Drop-down buttons can have a DropDownMenu assigned.

You can also find the bounding Rectangle of the button in the parent coordinate space.

 public class  ToolBarButton  : System.ComponentModel.Component {  // Public Constructors  public  ToolBarButton  ();    public  ToolBarButton  (string  text  );  // Public Instance Properties  public Menu  DropDownMenu  {set; get; }    public bool  Enabled  {set; get; }    public int  ImageIndex  {set; get; }    public ToolBar  Parent  {get; }    public bool  PartialPush  {set; get; }    public bool  Pushed  {set; get; }    public Rectangle  Rectangle  {get; }    public ToolBarButtonStyle  Style  {set; get; }    public object  Tag  {set; get; }    public string  Text  {set; get; }    public string  ToolTipText  {set; get; }    public bool  Visible  {set; get; }  // Public Instance Methods  public override string  ToString  ();  // overrides System.ComponentModel.Component   // Protected Instance Methods  protected override void  Dispose  (bool  disposing  );  // overrides System.ComponentModel.Component  } 

Hierarchy

System.Object System.MarshalByRefObject System.ComponentModel.Component(System.ComponentModel.IComponen, System.IDisposable) ToolBarButton

Returned By

ToolBarButtonCollection.this , ToolBarButtonClickEventArgs.Button

Passed To

ToolBarButtonCollection.{Add() , AddRange( ) , Contains() , IndexOf( ) , Insert() , Remove() , this} , ToolBarButtonClickEventArgs.{Button , ToolBarButtonClickEventArgs()}



. Net Windows Forms in a Nutshell
.NET Windows Forms in a Nutshell
ISBN: 0596003382
EAN: 2147483647
Year: 2002
Pages: 794

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net