Custom Search

Friday, January 30, 2009

EXAMPLE 1

EXAMPLE # 1:-

using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("\n\nHELLO");
}
}
}

C# SINGLE DIMENSION ARRAY CREATION

INTRODUCTION:-
An array is a technique of storing information of different items in a common variable of one name.
CODING EXAMPLE:-
This type of list can be created using a string-based array. Here is an example:
private void Form1_Load(object sender, System.EventArgs e)
{
string[] lstItemsNames = { "Women Coat", "Men Jacket", "Teen Jeans",
"Children Playground Dress" };
}
The above type of list is referred to as a single-dimensional. To provide more information about items, you can associate a second or even a third list to the first as follows:private void Form1_Load(object sender, System.EventArgs e)
{
string[] itemsNumbers = { "624376", "274952", "749752", "394085" };
string[] lstItemsNames = { "Women Coat", "Men Jacket", "Teen Jeans",
"Children Playground Dress" };
double[] itemsPrices = { 225.55, 175.75, 24.50, 75.05 };
}

C# CONTROL DATE TIME PICKER




INTRODUCTION:-

The Date and Time Picker is a control that allows the user to select either a date or a time value. This control provides two objects in one:

One of the advantages of the Date and Time Picker control is that it allows the user to select a time or a date value instead of typing it. This tremendously reduces the likelihood of mistakes.
To create a Date or Time Picker control, add a DateTimePicker control to a form or other container. The DateTimePicker control is based on the DateTimePicker class. In reality, the DateTimePicker control can be considered as two controls in one: you just have to choose which one of both controls you want to use.
TIME PICKER:-
The Time Picker control is a spin button made of different sections: the hours value, the minutes value, the optional seconds value, and the optional AM/PM string. To change the time, the user clicks a section and uses either the mouse or the keyboard to increase or decrease that particular value. To change another value, the user must first click it and then use the spin button.
By default, the time displays using the H:M:SS AM/PM format. This means that the time uses 1 digit for the hours from 0 to 9, 1 digit for the minutes from 0 to 9, 1 digit for the seconds from 0 to 9 and the AM or PM for morning or afternoon. To customize the way the time displays, first set the Format property to Custom. Then, in the CustomFormat property, use a combination of the following characters to create a custom format:

Format Used For Description
h Hour for 12-hour basis Used to display the hour with one digit if
the value is less than 10

hh Hour for 12-hour basis Used to display the hour with a leading 0 if
the value is less than 10

H Hour for 24-hour basis Used to display the hour with one digit if the
value is less than 10

HH Hour for 24-hour basis Used to display the hour with a leading 0 if
the value is less than 10

m Minute Used to display the minute with one digit if
the value is less than 10

mm Minute Used to display the minute with a leading 0 if
the value is less than 10

t AM/PM Displays the letter A or P for the AM or PM
section

tt AM/PM Displays the letters AM or PM for the last
section


You can set the format at design time using the Format field on the Properties window. To set the format at run time, assign the desired format to the DateTimePicker.CustomFormat property.
By default, after adding the control to the form or container, it assumes the time of the computer when the control was added. If you want to set a different time, apply a Format combination to the Value property. In the same way, at any time, you can retrieve the time value on the control by accessing the Value property.







C# CONTROL RADIO BUTTONS

INTRODUCTION:-
A radio button, sometimes called an option button, is circular control that comes in a group with other controls of the same type. Each radio button is made of a small empty circle O. From the group, when the user clicks one of them, the radio button that was clicked becomes filled with a big dot 8. When one of the radio buttons in the group is selected and displays its dot, the others display empty circles. To guide the user as to what the radio buttons mean, each is accompanied by a label.
To create a radio button, on the Toolbox, you can click the RadioButton control . Alternatively, you can declare a RadioButton class and use the form's constructor to initialize the radio buttons. Because radio buttons always come as a group, you should include them in another control that visibly shows that the radio buttons belong to the same group. The most common control used for this purpose is the group box created using the GroupBox control
CODE OF RADIO BUTTON:-
If (radiobutton1.Checked==true)
{
MessageBox.Show("OK");
}
else
{
MessageBox.Show("Error");
}

Thursday, January 29, 2009

C# CONTROL LINK LABELS

INTRODUCTION:-

In the pass, to add an internet or email link to a form, there were many steps to follow. As the internet and email had become an integral part of the culture, it was also time to have an appropriate control adapted for this need. To address this issue, a control called LinkLabel was added to the .NET Framework.

WORKING OF A LINK LABEL:-

Link label to provide link to another pages to click the link lable color is change to supose that you have click the link label and color donot change so you have choose the before click color and after click color is same select.