UltraButton Control.
The Infragistis UltraButton offers all the features and events as the Windows forms
button and adds all the great presentation features and styles. The styles include
Office2007, Office2003, VisualStudio, XP and Office2000. You can use the ShapeImage
property to set a artistic button shape.
Namespace: Infragistics.Win.Misc
Assembly: Infragistics2.Win.Misc.v6.3.dll
using Infragistics.Win.Misc;
Calling: Infragistics.Win.Misc.UltraButton
Creating a new Infragistics.Win.Misc.UltraButton control.
Infragistics.Win.Misc.UltraButton ultrabutton1 = new Infragistics.Win.Misc.UltraButton();
Adding the button control to a Windows form.
this.Controls.Add(ultrabutton1);
Placing the button on the form at a specific location.
ultrabutton1.Location = new Point(50, 50);
Assigning a text value to a button control.
ultrabutton1.Text = "Enter";
Assigning a click event to the button control.
ultrabutton1.Click+=new EventHandler(ultrabutton1_Click);
Responding to the buttons click event.
private void ultrabutton1_Click(object sender, EventArgs e)
{
//The MessageBox is part of the System.Windows.Forms namespace.
MessageBox.Show("HelloWorld");
}
Changing the background color of the button control.
ultrabutton1.Appearence.BackColor = System.Drawing.Color.Red;
To disable the button control.
ultrabutton1.Enabled = false;
Here the Button control is still visible (partially faded) but will not respond
to any events. To re-enable the Button control you would set the Enabled property
to true. When adding the button control the default setting is for the control to
be Enabled.
The UltraButton
control from Infragistics includes preloaded style formats including XP style, Visual
Studio style, Office2003 Style and Office2007 style. You can also create your own
appearence styles by editing the appearence properties.
To change the UltraButton style you simply change the buttonstyle property.
ultraButton.ButtonStyle = Infragistics.Win. UIElementButtonStyle.Office2003ToolbarButton;
To assign an Image for the button shape.
this.ultraButton1.ShapeImage = Image.FromFile(@"c:\Icons\helloworld.png");
Tip: When using the ShapeImage property, use a good quality image (32bit) and then
make use of the Button appearance properties, making use of the BackColor, BackColor2
and the BackGradientStyle.
|
|