UNIT2
UNIT2
BASED
TECHNOLOGY
COMPONENT BASED TECHNOLOGY
UNIT-II
APPLICATION DEVELOPMENT USING C# .NET
3Mark:
1.Define Windows Programming?
Visual Studio .NET y; ,uz;L User Interface fs; c s ; s d
(i) Windows Form
(ii) Web form
Windows Forms: Windows Application i a c U t h f ; f gad;gLfpd;wd.
Web Forms: Web Application fi s c U t h f ; f gad;gLfpd;wd.
Define Event?
2.
Clcik: Button,label Nghd;w xU Control kPJ runtime y; click nra;Ak; NghJ , e ; j Event
Vw;gLfpwJ
Load: xU form M d J Load MFk; NghJ , e ; j event Vw;gLfpwJ. Load event y; code
vOjg;gLLhy;; form xt;nthU K i w Load MFk;
Mouse Move: Mouse Pointer [ label ,button Nghd;w xU Control kPJ efh;j;jpdhy;
Mouse mouse event Vw;gLfpwJ.
Mouse down: Mousey; c s ; s Key fPNo mOj;jk; NghJ Mouse down event
Vw;gLfpwJ.
Mouse Up: fPNo mOj;jpd; Mouse Key [ tpLtpf;Fk; NghJ Mouse up event
Vw;gLfpwJ.
Prepared by
Kalaiyarasi S
HOD/Comp Page 2
COMPONENT BASED TECHNOLOGY
Design Time:
Design Neuj;jpy; user j d f ; F tpUg;gkhd Kiwapy; xU form [ design
nra;fpwhh;
Run time:
Run time Neuj;jpy; me;j form ,af;fg;gL;L N j i t a h d input fi s form
topahf ngw;Wf; nfhz;L output [ ntspapLfpwJ
Prepared by
Kalaiyarasi S
HOD/Comp Page 3
COMPONENT BASED TECHNOLOGY
Button:
xU Fwpg;gpL;L function [ execute nra;tjw;F nghJthf , e ; j control
gad;gLfpwJ
if checkedbox1.checked
{
Texbox1.font=font(“aril”,12,drawing.fontstyle.italic)
(iii) }
Checkbox2 f;fhd checkedchanged event y; code [ edit
if(checkbox2.checked)
nra;Ak;
{
Textbox1.font=font(“courier”,11,drawing.fontstyle.bold)
}
(iv) F5 [ mOj;jp run nra;aTk;
Combobox:
Edit nra;Ak; t r j p A i L a drop down list [ cUthf;Ftw;F , e ; j control
gad;gLfpwJ
Properties : Font,Dropdownwidth etc
Methods: Selected index,add,clear etc
Eg:
(i) Windows application nra;aNtz;Lk;
[ open (ii)
Button1 f;fhd click event y; code [ edit
Combobox1.items.add(“select”)
nra;Ak;
(iii) Button2 f;fhd click event y; code [ edit nra;Ak;
Combobox1.items.clear()
(iv) F5 [ mOj;jp run nra;aTk;
List Box:
gy cWg;Gf;fi s nfhz;L xU gL;bai y fhL;Ltjw;F , e ; j control
gad;gLfpwJ.me;j
list ypUe;J xd;W m y ; y J mjw;F Nkw;g;gL;L cWg;Gf;fi s select nra;J nfhs;syhk;
Properties: Selectedindex,selecteditem
etc Methods:
Items.add-Gjpa c W g ; G fi s
Nrh;g;gjw;F
Items.insert:Gjpa c W g ; G fi s user
epidj;j ,Lj;jpy; Nrh;g;gjw;F
Items.remove: XNu xU cWg;ig
ePf;Ftjw;F
Items.clear: List y; c s ; s vy;yh
cWg;Gfi sAk; ePf;Ftjw;F
Eg:
(i) Windows application
[ open
nra;aNtz;Lk;
(ii) Button1 f;fhd click
event y; code [ edit
nra;Ak;
Listbox1.items.add(“orange
”)
(iii) Button2 f;fhd click
event y; code [ edit
nra;Ak;
Listbox1.items.clear()
(iv) F5 [ mOj;jp run
nra;aTk;
Eg:
(v) Windows application [ open nra;aNtz;Lk;
(vi) Radio Button1 f;fhd click event y; code [ edit nra;Ak;
If(Radio button1.checked)
{
Prepared by Textbox1.font=new font(“arial”,12)
Kalaiyarasi S }
(iii)
HOD/Comp mijg;NghyNt radiobutton2 f;F times new roman font k; Page 5
radiobutton3 f;F
impact font k; assign nra;tjw;F code vOjTk;
(iv) F5 [ mOj;jp run nra;aTk;
COMPONENT BASED TECHNOLOGY
(i) xU Gjpa Form [ Open nra;f.Menustrip vd;w control [ drag nra;J form
y; i t f ; f T k ;
(ii) Typehere vd;w text kPJ click nra;f .,jpy; &file vd;W type nra;f.& vd;w
symbol
M d J F xU access key v d ; g i j
(iii) File menu f;F fPNo new,open,save exit Mfpatw;iw type nra;f.
(iv) View menu f;F fPNo &toolbox, Status bar Mfpatw;iw type nra;f
(v) Program y; gad;gLj;j trjpahf xt;nthU menu item d; ngaiuAk;
khw;wp mikf;fTk;
(vi) xU menu item slect nra;ag;gLk; NghJ eiLngw Ntz;ba function fi s
vOj mjd; kPJ double click nra;J gpd;G Code vOjTk;
(vii) Form y; VNjDk; xU ,Lj;jpy; click nra;JtpL;LL run nra;f
(viii) ,jpy; VNjDk; xU menu item [ click nra;jhy; mjw;Nfw;w Process
eiLngWk;
Context menu:
xU form m y ; y J control kPJ right click nra;Ak; NghJ Njhd;Wfpw menu Tf;F
context menu vd;W ngah;
(i) System context menu
(ii) Custom context menu
System and custom context menu:
xU form m y ; y J control kPJ right click nra;Ak; NghJ jhdhf Njhd;Wk; menu Tf;F
system context menu vd;W ngah;
xU form m y ; y J control kPJ right click nra;Ak; NghJ Njhd;w Ntz;ba menu i t
user j d J tpUg;gg;gb mikj;jpUe;jhy; mjw;F custom context menu vd;w ngah;
Steps:
<<
1. xU Gjpa form [ open nra;f Context menustrip vd;w Control [ drag nra;J form
y; i t f ; f T k ;
2. Typehere vd;w text [,click nra;J saveas,print,hide Mfpatw;iw type nra;aTk;
3. Form f;fhd property window i t open nra;J contextmenu vd;w property y;
mjd; ngaiu nfhLf;fTk;
4. Application [ run nra;aTk;
Prepared by
Kalaiyarasi S
HOD/Comp Page 6