.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Infragistics - WINLABEL CONTROL

Posted By:Deepika Haridas       Posted Date: February 01, 2010    Points: 10    Category: Visual Studio    URL: http://www.dotnetspark.com  

The WinLabelT control is a basic label type control. Much of the included functionality in the intrinsic label (autosize, mnemonics, image and text) is provided as well as some additional functionality, including:
 

Infragistics - WINLABEL CONTROL


The WinLabelT control is a basic label type control. Much of the included functionality in the intrinsic label (autosize, mnemonics, image and text) is provided as well as some additional functionality, including:

1. Appearance support -- Full Appearance support including alphablending, gradients, etc.

2. HotTracking -- Alter the appearance of the label when the mouse is over the element.


3. BorderStyleInner/BorderStyleOuter -- The two borderstyles can be used to create additional border effects - "bump" border, etc. The InnerBorderPadding controls the space allocated between the inner and outer border.


4. ImageSize -- Control the size of the image displayed in the label.


5. WrapText -- Determines whether text will wrap when the element is not wide enough to display the entire text.


Infragistics - WINLABEL


Infragistics - WINLABEL

EXAMPLE (FONT)

using Infragistics.Win;

private void SetGridFont()
{
  FontData fd= this.ultraGrid1.DisplayLayout.Appearance.FontData;
  fd.Bold = DefaultableBoolean.True ;
  fd.Italic = DefaultableBoolean.True;
  fd.Name = "Times New Roman";
  fd.Underline = DefaultableBoolean.True;
}

EXAMPLE (TEXT)
 

public override string Text 
{
     get; 
     set;
}

EXAMPLE (AUTO HIDE)

 

using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;

private void CreateShapeImage(Infragistics.Win.Misc.UltraButton button)
{
    // create a bitmap that will be used to provide the shape
    // of the button.
    Bitmap bitmap = new Bitmap(100,100);

    // create a temporary graphics object so we can render into it
    using (Graphics g = Graphics.FromImage(bitmap))
    {
       // draw the background in white. whatever color is in the lower left hand pixel will be assumed to be transparent
       g.Clear( Color.White );
       // draw our circle in a different color
       g.DrawEllipse( Pens.Black , 0, 0, 99, 99 );
       // make sure to fill it in or the only displayed part of the button will be the outline of the circle
       g.FillEllipse( Brushes.Black, 0, 0, 99, 99 );
    }

    // set the shape
    button.ShapeImage = bitmap;

    // autosize to the shape image
    button.AutoSize = true;
}

More resources related to Infragistics:


Nested tables in Ultragrid


WinToolTipManager



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend