Spread Windows Forms 13.0 Product Documentation
FarPoint.Win Assembly / FarPoint.Win Namespace / SuperEditBase Class / Picture Property
Example


In This Topic
    Picture Property (SuperEditBase)
    In This Topic
    Gets or sets the picture to display in the edit control.
    Syntax
    'Declaration
     
    Public Overrides Property Picture As Image
    'Usage
     
    Dim instance As SuperEditBase
    Dim value As Image
     
    instance.Picture = value
     
    value = instance.Picture
    public override Image Picture {get; set;}

    Property Value

    Image object containing the picture for the edit control
    Remarks

    Some controls can display pictures in layers. The first layer consists of a foreground picture, next comes the content of the control, such as text and a picture, then comes the background picture, and finally, the background color of the control.

    Set this property to specify the picture for the content layer. Set the ForegroundImage property to specify the foreground picture layer. Set the BackgroundImage property to specify the background picture layer.

    This property is available at run time only.

    Tips

    Specify the alignment for the contents in an element using the AlignHorz property.

    You can work with the positioning of the picture by setting the MarginTop, MarginBottom, MarginLeft, and MarginRight properties. These properties leave space between the edge of the picture and the edges of the control.

    You can also set the PictureMargin property to specify the margin to use between the picture and the text in the control.

    Specify the orientation of the picture by setting the PictureOrientation property.

    You can use the various pictures' transparency colors feature to display portions of the underlying content and other pictures in the element. For the picture layer, set the PictureTransparencyColor property.

    Note: If the computer is in 256-color mode and the element displays a picture and a foreground picture that have different palettes, the palette for the foreground picture will override the palette for the picture.

    If the application changes the picture, the PictureChanged event occurs.

    Example
    This example shows the use of this property with related settings of text and a picture in the same control.
    control.Text = "Alignment test";
    control.Picture  = System.Drawing.Image.FromFile("d:\mail16A.ico")
    control.PictureMargin = 25
    control.PictureOrientation = FarPoint.Win.PictureOrientation.PictureRotate90;
    control.PictureTransparencyColor = Color.Blue;
    control.AlignText = FarPoint.Win.TextAlign.TextLeftPictRight;
    control.TextOrientation = FarPoint.Win.TextOrientation.TextTopDown;
    
    control.Text = "Alignment test"
    control.Picture = System.Drawing.Image.FromFile("d:\mail16A.ico")
    control.PictureMargin = 25
    control.PictureOrientation = FarPoint.Win.PictureOrientation.PictureRotate90
    control.PictureTransparencyColor = Color.Blue
    control.AlignText = FarPoint.Win.TextAlign.TextLeftPictRight
    control.TextOrientation = FarPoint.Win.TextOrientation.TextTopDown
    
    See Also