[]
Gets or sets the background color of blank areas in Form when to zoom and scroll.
public Color BackColor { get; set; }
Type | Description |
---|---|
Color | A Color value that represents the background color of blank areas in Form when to zoom and scroll. The default is Color.Empty, means use the BackColor of Form. |
The BackColor property does not support transparent colors.
The following code example shows how to use this property.
public class GcZoomBackColorDemo : Form
{
private Button _backColorButton;
private Button _backImageButton;
private GcZoom _gcZoom1 = new GcZoom();
public GcZoomBackColorDemo()
{
InitializeComponent();
_gcZoom1.Target = this;
_backColorButton.Click += _backColorButton_Click;
_backImageButton.Click += _backImageButton_Click;
}
void _backColorButton_Click(object sender, EventArgs e)
{
this._gcZoom1.BackColor = SystemColors.ControlDarkDark;
}
void _backImageButton_Click(object sender, EventArgs e)
{
this._gcZoom1.BackgroundImage = Image.FromFile(@"c:\backimage.jpg");
this._gcZoom1.BackgroundImageLayout = ImageLayout.Stretch;
}
private void InitializeComponent()
{
_backColorButton = new Button();
_backColorButton.Text = "BackColor";
_backColorButton.Location = new Point(20, 20);
_backColorButton.Size = new Size(120, 25);
_backImageButton = new Button();
_backImageButton.Text = "BackImage";
_backImageButton.Location = new Point(20, 50);
_backImageButton.Size = new Size(120, 25);
this.Controls.Add(_backColorButton);
this.Controls.Add(_backImageButton);
}
}
Public Class GcZoomBackColorDemo
Inherits Form
Private _backColorButton As Button
Private _backImageButton As Button
Private _gcZoom1 As New GcZoom()
Public Sub New()
InitializeComponent()
_gcZoom1.Target = Me
AddHandler _backColorButton.Click, AddressOf _backColorButton_Click
AddHandler _backImageButton.Click, AddressOf _backImageButton_Click
End Sub
Private Sub _backColorButton_Click(sender As Object, e As EventArgs)
Me._gcZoom1.BackColor = SystemColors.ControlDarkDark
End Sub
Private Sub _backImageButton_Click(sender As Object, e As EventArgs)
Me._gcZoom1.BackgroundImage = Image.FromFile("c:\backimage.jpg")
Me._gcZoom1.BackgroundImageLayout = ImageLayout.Stretch
End Sub
Private Sub InitializeComponent()
_backColorButton = New Button()
_backColorButton.Text = "BackColor"
_backColorButton.Location = New Point(20, 20)
_backColorButton.Size = New Size(120, 25)
_backImageButton = New Button()
_backImageButton.Text = "BackImage"
_backImageButton.Location = New Point(20, 50)
_backImageButton.Size = New Size(120, 25)
Me.Controls.Add(_backColorButton)
Me.Controls.Add(_backImageButton)
End Sub
End Class