This article will show you how you can use a Stylish
ToolStrip Button Control with Image and Text Control In Windows Application
Using C#.Net. This will show the image with large image.
Some of my previous articles are as follows: No
of Days Between Two Dates By Using TimeSpan In Windows Application In C#.Net
and VB.Net, Validate
Directory Exist or Not in C#.Net In Windows Application, Image
Save In XML and Load XML Bitmap Image File in Windows Application Using C#.Net,
How
to Save Record in XML File and Read XML to Display in DataGridview Using C#.net
in Windows Application, How
to Add HyperLink and Retrieve Row Value on Link Click in DataGridView #,
Windows application, How
to Add Button Control and Retrieve Row Value on Button Click in DataGridView
Using C#.Net, Windows Application, Save
Panel with Control Inside It as Image C#.net, VB.net in windows application,
Confirmation
Message on Button Click and Capture YES/NO Click by User in Windows
application, C#.
So for this article first I have created a new windows application.
In this form add a tool strip control.
Now add a button on tool strip control and select the image.
After selecting image your form control will look as shown below.
Now for making it stylish I will make some property changes.
First we will select image.
After selecting image it show only image, for displaying text also we
will set property DisplayStyle.
Now for putting image above the text we will set the below
property TextImageRelation.
After setting it’s showing small image, now we will set
property to make the image look more visible. For this we will set property
ImageScaling.
After setting all the properties your form control will look as shown below.
Now we have done. Now we will add click event on button. Please
check the below code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void toolStripButton1_Click(object sender, EventArgs
e)
{
MessageBox.Show("This is new button click.");
}
private
void toolStripButton2_Click(object sender, EventArgs
e)
{
MessageBox.Show("This is exit button click.");
}
}
}
|
Now we have done run the application to check the output.
0 comments:
Please let me know your view