list box control
===========
this contol is used to display group of items to the [Link] that user can select a
single item or group of items randomly
BUTTON1(ADD) BUTTON2(INSERT) BUTTON3(REMOVE) BUTTON4(REMOVEAT) BUTTON5(CLEAR)
BUTTON6(CLOSE)
LEBEL1(ENTER ANY ITEM) LABEL2(ENTER INDEX VALUE)
BUTTON1_CLICK
==========
[Link]([Link])
BUTTON2_CLICK
===========
[Link](convert.toint32([Link]),[Link]);
BUTTON3_CLICK
===========
[Link]([Link]);
BUTTON4_CLICK
==========
[Link](convert.toint32([Link]);
BUTTON5_CLICK
===========
[Link]();
BUTTON6_CLICK
============
[Link]();
creating controls dynamically
====================
[Link] object for respective control class
[Link] the required properties to the object
[Link] this object to the controls collection of form class
BUTTON1_CLICK
==========
TextBox t1=new TextBox();
[Link]=200;
[Link]=50;
[Link](t1);
Label l1=new Label();
[Link]=10;
[Link]=50;
[Link]=true;
[Link]="Enter Any Text";
[Link](l1);
=======================
checkbok control
==========
this control is used to provide selection of more than one option from the given
group of options
BUTTON1_CLICK
==========
string s=[Link]+"hobbies are :";
if ([Link]==true)
s=s+[Link]+" ";
if([Link]==true)
s=s+[Link]+" ";
if([Link]==true)
s=s+[Link]+" ";
if([Link]==true)
s=s+[Link]+" ";
[Link]=s;
common dialog controls
===============
these controls are used to perform some tasks like opening a file,saving a
file,applying font attributes,color attributes,performing page
settings, print settings etc.
types of common dialog controls
=====================
open file dialog control
open file dialog control
===============
this control is used to display,open file dialog box to the user so that user can
select any file to open
save file dialog control
==============
this control is used to display save file dialog box to the user so that user can
enter any file name to save
font dialog control
===========
this control is used to display font dialog box th the user , so that user can
select required font attributes to apply to the required data
color dialog control
============
this control is used to display color dialog box to the user so that user can
select required color to apply to the required data
BUTTON1_CLICK
===========
[Link]="TextFiles|*.txt|Word Document|*.doc|All Files|*.*";
[Link]();
[Link]=[Link];
BUTTON2_CLICK(SAVE EXAMPLE)
=======================
savefileDialog1.showDialog1();
[Link]=[Link];
BUTTON3_CLICK(FONT EXAMPLE)
=====================
fontDialog1.showDialog1();
[Link]=[Link];
BUTTON4_CLICK(COLOR EXAMPLE)
======================
[Link]();
[Link]=[Link];
tree view control
===========
this control is used to display the required item or data in hieracial manner
BUTTON1_CLICK
===========
[Link]("Sai Trust")
[Link]("Govt Trust")
[Link]("public Trust")
[Link][0].[Link]("Schools")
[Link][0].[Link]("Colleges")
[Link][0].[Link]("Homes")
[Link][0].nodes[0].[Link]("primary school")
[Link][0].nodes[0].[Link]("high school")
[Link][0].nodes[1].[Link]("junior College")
[Link][0].nodes[1].[Link]("Degree College")
[Link][0].nodes[1].[Link]("pg College")
[Link][0].nodes[1].[Link]("Engg College")
[Link][0].nodes[2].[Link]("OldAge Home")
[Link][0].nodes[2].[Link]("Orphan Home")
[Link][0].nodes[2].[Link]("primary Peace")
timer control
========
this control is used to execute the required code repeatedly again and again with
out any user involment
property
======
enable:- true
as long as enabled is true timer will be working.
default is false(i.e timer stops working
intervel:-time period in milli seconds. 1000 milli seconds=1 second
public partial class
int i=0;
TIMER1_TICK
========
if(i==0)
[Link]="Orbit Technologies";
[Link]=[Link]
[Link]=[Link];
i=1;
}
else
{
[Link]="Hyderabad";
[Link]=[Link]
[Link]=[Link]
i=0;
============================
picture box control
==========
this control is used todisplay the images to the user on the form. we can display
images like JPEG,BMP,ICON,GIFF etc
BUTTON1_CLICK
===========
[Link]="jpeg files|*.jpg|Giff Files|*.Gif|Bitmap Files |*.Bmp|All
Files|*.*";
[Link]();
//[Link]=[Link];
[Link]=[Link]([Link]);
picture box properties
==============
image:-
=====
sets or gets the image to be displayed in the picture box control
image location
=========
sets or gets the file path of the image to be displayed in the picture box control
size mode
=======
normal(default)/stretch image/auto size/centre image
normal:-
=====
picture box and image will have there own sizes, there do not be any change in
image size when picture box changes
stretchImage
========
image will be scaled to picture box size, image size will increse or decrease
according to picture size
auto size
======
picture box will be scaled to image size. it is not possible to increse or
decrease either picture box size or image size
centre image
========
image will be displayed with in the centre location of picture box
grouping controls
============
the user can able to select one radio button but if the user would like to select
more then one radio button then we use grouping controls
[Link] box
========
take 2 group controls and place 4 radio buttons for fore color and 4 radio buttons
for back ground colors
OPRED_CHECKEDCHANGED
=================
[Link]=[Link]
OPGREEN_CHECKEDCHANGED
===================
[Link]=[Link]
OPBLUE_CHECKEDCHANGED
==================
[Link]=[Link]
OPWHILTE_CHECKEDCHANGED
====================
[Link]=[Link]
OPYELLOW_CHECKEDCHANGED
======================
[Link]=[Link]
OPMEGENTA_CHECKEDCHANGED
======================
[Link]=[Link]
OPGOLD_CHECKEDCHANGED
==================
[Link]=[Link]
OPBLACK_CHECKEDCHANGED
====================
[Link]=[Link]
image list control
============
this control is used to store the images required to be used with in the
application. we can store the images like JPEG,BMP,GIFF,ICON
images
digital album
========
public partial class:form
i=0;
TIMER1_CLICK
=========
[Link]=[Link][i];
i++;
if(i==[Link])
{
i=0;
}
combo box control
============
text box:-
====
advantage:-user can enter the data at run time
dis advantage:-it is not possible to display group of items to the user
list box:-
=====
advantage:- we can display group of items to the user.
dis-advantage:-we can not enter any data at run time
combox is combination of both text box and list box
namespace ComboBoxExample
{
public partial class Form1 : Form
{
//create reference variables
Label label1, label2, label3;
ComboBox combobox1;
public Form1()
{
InitializeComponent();
/* form properties */
[Link] = "ComboBox Example";
[Link] = new Font("Tahoma", 20);
[Link] = new Size(550, 300);
/* creating label1 */
label1 = new Label();
[Link] = "Country: ";
[Link] = true;
[Link] = new Point(50, 50);
[Link](label1);
/* creating label2 */
label2 = new Label();
[Link] = "Selected item here";
[Link] = true;
[Link] = new Point(180, 120);
[Link](label2);
/* creating label3 */
label3 = new Label();
[Link] = "Selected index here";
[Link] = true;
[Link] = new Point(180, 170);
[Link](label3);
/* creating combobox1 */
combobox1 = new ComboBox();
[Link] = new Size(200, 40);
[Link] = new Point(180, 50);
[Link] = [Link];
string[] countries = new string[] { "India", "China", "UK", "USA", "Japan" };
[Link](countries);
[Link] += Combobox1_SelectedIndexChanged;
[Link](combobox1);
}
private void Combobox1_SelectedIndexChanged(object sender, EventArgs e)
{
/* get selected item */
object obj = [Link];
string s = [Link](obj);
[Link] = s;
/* get selected index */
int n = [Link];
[Link] = [Link](n);
}
}
}
==========================================
working with menus
============
any window based application will provide 2 types of menus
1. main menu 2. context menu
main menu
=======
this will be available at the top of the application
every application can contain only one main menu
to create main menu we have menu strip control
context/shortcut menu
================
this menu is displayed when users clicks right mouse button with the application
an application can contain any number of context menus based on requirment
to create main menu we have context menu strip control
SMENU_CLICK
=========
[Link]();
[Link]=[Link]
SMENUSAVE_CLICK
============
[Link]();
[Link]=[Link];
SMENUEXIT_CLICK
===========
[Link]();
SMENUfONT_CLICK
============
[Link]();
[Link]=[Link]
SMENUFORECOLOR_CLICK
=================
[Link]();
[Link]=[Link]
SMENUBACKCOLOR_CLICK
=================
[Link]();
[Link]=[Link]
contextmenu example
==============
MNUFONT_CLICK
===========
[Link]();
[Link]=[Link]
SMENUFORECOLOR_CLICK
=================
[Link]();
[Link]=[Link]
SMNUBACKCOLOR_CLICK
================
[Link]();
[Link]=[Link]
note:-to assign contextmenu strip control to text box
select textbox properties goto context menu property select context menu strip
control