| InputPanel for WinForms Task-Based Help > Adding a Background Image to C1InputPanel |
You can add a background image to the C1InputPanel control using the designer or code.
Adding the Background Image Using the Designer
To add a background image to the panel, complete these steps:
| Layout Setting | Description |
|---|---|
| None | The image will be placed in the upper left-hand corner of the control and will retain its original size. |
| Tile (default) | The image will repeat horizontally and vertically to fill the entire control. |
| Center | The image will be placed in the center of the control and will retain its original size. |
| Stretch | The image will stretch to fill the entire control. |
| Zoom | The image will stretch as large as possible while maintaining its original aspect ratio. |
Your C1InputPanel now has a background image that is laid out to your specifications.
Adding the Background Image Programmatically
Complete the following steps to add a background image and sets its layout to tile:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Imports C1.Win.C1InputPanel |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
using C1.Win.C1InputPanel; |
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
c1InputPanel1.BackgroundImage = Image.FromFile("C:\Backgrounds\YourCustomImage.gif")
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
c1InputPanel1.BackgroundImage = Image.FromFile(@"C:\Backgrounds\YourCustomImage.gif"); |
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
c1InputPanel1.BackgroundImageLayout = ImageLayout.Tile |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
c1InputPanel1.BackgroundImageLayout = ImageLayout.Tile; |
|
The image below features a C1InputPanel control with a tiled background image: