using System.Drawing;
using System.ComponentModel;
using FastReport.Utils;
using System.Windows.Forms;
namespace FastReport.Dialog
{
///
/// Represents a standard Windows label.
/// Wraps the control.
///
public partial class LabelControl : DialogControl
{
private Label label;
#region Properties
///
/// Gets an internal Label.
///
[Browsable(false)]
public Label Label
{
get { return label; }
}
///
/// Gets or sets a value indicating whether the control is automatically resized to display its entire contents.
/// Wraps the property.
///
[DefaultValue(true)]
[Category("Layout")]
public bool AutoSize
{
get { return Label.AutoSize; }
set { Label.AutoSize = value; }
}
///
/// Gets or sets the alignment of text in the label.
/// Wraps the property.
///
[DefaultValue(ContentAlignment.TopLeft)]
[Category("Appearance")]
public ContentAlignment TextAlign
{
get { return Label.TextAlign; }
set { Label.TextAlign = value; }
}
#endregion
#region Public Methods
///
public override void Serialize(FRWriter writer)
{
LabelControl c = writer.DiffObject as LabelControl;
base.Serialize(writer);
if (AutoSize != c.AutoSize)
writer.WriteBool("AutoSize", AutoSize);
if (TextAlign != c.TextAlign)
writer.WriteValue("TextAlign", TextAlign);
}
#endregion
///
/// Initializes a new instance of the LabelControl class with default settings.
///
public LabelControl()
{
label = new Label();
Control = label;
Label.AutoSize = true;
}
}
}