In this article i will show you , how to generate tooltip on controls using c# code. By using tooltip we can put some hints about task. I will give you an example of ToolTip in windows form c#. In this article we will use ToolTip class with their SetToolTip method.
In this article i will show you how to change windows phone 8.1 app icon using manifest file. You can set your image file in place of default icon file. The default app icon file looking like cross square. I will provide you step by step guide to change the icon file or you can say image file.
Double click on Package.appxmanifest file.
Select Visual Assets tab.
Add new image in Assets folder with 44x44 resolution.
In this article i will show you how to add columns in DataGrid using xaml code and c# code. I will give you an example of add columns in WPF DataGrid. Datagrid is used to represent a tabular view of data in programming. It have multiple template designs to be customizable by the programmer as per the requirements. It supports some other features like sorting the data, dragging columns and sometimes editing when user needs to do.
To add a DataGrid, just drag-n-drop it from the toolbox. Now it is known as a tabular representation, write following code to add some columns (3 here):
<DataGrid>
<DataGrid.Columns>
<DataGridTextColumn Header="First Column"/>
<DataGridTextColumn Header="Second Column"/>
<DataGridTextColumn Header="Third Column"/>
</DataGrid.Columns>
</DataGrid>
When we run this window then a Datagrid is shown with three columns like in below image:
DataGrid provides columns sorting, reordering and sizing with some properties like CanUserReorderColumns, CanUserResizeColumns, CanUserSortColumns and etc. We can even perform grouping of data by adding a group description for the list to be bind.
To add a datagrid using code behind:
DataGrid dataGrid = new DataGrid();
DataGridTextColumn textColumn1 = new DataGridTextColumn();
textColumn1.Header = "First Column";
DataGridTextColumn textColumn2 = new DataGridTextColumn();
textColumn2.Header = "Second Column";
DataGridTextColumn textColumn3 = new DataGridTextColumn();
textColumn3.Header = "Third Column";
dataGrid.Columns.Add(textColumn1);
dataGrid.Columns.Add(textColumn2);
dataGrid.Columns.Add(textColumn3);
The above code snippet add a same datagrid with three columns as in above image. We will learn binding of datagrid in later articles.
Introduction
In this article i will show you, how to change the shape of the current form. The default form shape is square and i want to change it in ellipse form. Copy this code and paste into your code file.
Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath shape1 = new System.Drawing.Drawing2D.GraphicsPath();
shape1.AddEllipse(0, 0,this.Width, this.Height);
this.Region = new System.Drawing.Region(shape1);
}
}
} Code generate the following output
Introduction
In this article i will show, how to bind chart control with database table in asp.net c#. I will give you example of it also provide video for implementation. A graph or chart diagram represents your set of data.If you want to show your company report then you must use chart control. There are different types of chart show different types of data such as
Pie Chart
Using the pie-chart you can classify your data in graphical format. According to above diagram your movie are divided in different sections such as Action take 18% of whole movie as well as 11% take Horror.
Example of How to bind Chart Control using SqlDataSource
In this article i will show you how to do cut copy and paste operation on text which is entered in the TextBox. I will give you an example of it. It is impossible for one, specially a Programmer, to imagine his/her life without editing. Editing operations (Cut/Copy and paste etc.) are performed using clipboard, so these are also called Clipboard operation.
Invention
Larry Tesler, who invented Cut/Copy and paste in 1973. He is a computer scientist, working in the field of human-computer interaction. Tesler has worked at Xerox PARC, Apple Computer, Amazon.com and Yahoo! We can find out more about LarryTesler.
In this article I will show how to perform these operations with our own code. As we are just doing editing operations, it doesn't matter which control we are using. Here I am using two textboxes to perform this operation. I created a simple window form with a menu strip and two textboxes. In the menu strip all the operations are added in Edit menu item as shown in below screenshot.
Generate the click event of above three menu items.
Copy
We are going to copy the selected text of textbox, so we use SelectedText property of textbox. To copy the data in clipboard there is a method in Clipboard class i.e. SetData(), which will clear the clipboard and then add new data in specified format to clipboard.
Actually, cut operation is a combination of copying and removing that text from that location. So we will copy the text and empty that string after that.
To insert clipboard data to current location is called paste. We can perform a paste operation multiple times with a single clipboard data. To paste the data from clipboard there is a method in Clipboard class i.e. GetText(). First we get actual position of cursor in the textbox and then insert the data to that position using Insert() method as in above code.
Insert() is a method of string class, which return a string in which a specified string is inserted at a specified position. So that is how we perform editing operations with our own code. The same procedure can be used to perform these operation in other controls of windows forms.
In this article we will learn how to bind CheckBoxList in asp.net c#. I will give you an example of CheckBoxlist binding. you can use a CheckBoxList control to display a number of check boxes at once as a column of check boxes. The CheckBoxList control exists within the System.Web.UI.WebControls namespace. This control is often useful when you want to bind the data from a datasource to checkboxes . The CheckBoxList control creates multiselection checkbox groups at runtime by binding these controls to a data source.
Public Properties of the CheckBoxList class
Cellpadding : Obtains the distance between the border and data of the cell in pixels.
CellSpacing : Obtains the distance between cells in pixels.
RepeatColumns : Obtains the number of columns to display in the CheckBoxList control.
RepeatDirection : Obtain a value that indicate , whether the control displays vertically or horizontally.
RepeatLayout : Obtains the layout of the check boxes.
TextAlign : Obtains the text placement for the check boxes within the group.