Core IT Solution



Unit-11. .Net ??? ????????? ?? ????? .Net ????????? ??? ????? ??? ?????????? ?? ?? ?????? ?? ?? ?? .Net ????? ????????? ?? ?? ????? ?????????? ?? ??????????? ???? ?? ??? ???? ???? ?? | .Net ????????? ??? ?????????? ???????? (C#, , J#, C++.NET, ), ??????? ??????????, ?????? ??????? (CLR), ?????? ???????, ??????? ??????, ????? ??????, ??????? ????, ???? ?? ???? ????????, ?????????? ????????? ?? ??? ????? ????????? ????? ???? ??? | .Net ????????? ?? ??????? ?? ??????, ?? ??? ??????, ????? ???????????, ???? ????? ?? ???? ???? ?? ??????????? ?? ??????? ????, ?????????? ???? ??? ????? ?? ??? ?? ??????? ?? ? .??? ????????? ?? ?????? ??? CLR ?? .??? ????????? ????? ????????? ?????????: .NET ????????? .Net ????????? ?? ???? ???? ???????? ??????: .Net ????????? ?? ???? ?????????? ??? .Net ???? ???????? ?????? (CLR) ?? ???? ??????? ??? .Net ?????? ??? ???? ??? .Net ????????? ?? ?????? ??????? ?????? ???? ?? ???? ???? ???????? ?????? ?? CLR (???? ??? ???? ??????? ???? ?? JVM ?? ????) ??? ???? ??, ?? ??? ?? ???????? ?? ?????? ???? ?? ?? ?? ????????? ?? ??????????? ?? ??? ?????? ?????? ?????? ???? ??? ?? ?? ????????? ???? ?? ?? ???????? ?????? ?? ??? ???? ?? ?? .NET ????????? ?? ??????????? ?? ???????? ?? ???????/?????? ???? ?? | .Net ????????? ????????? ??? ?? ???????? ?????? ?? ????? ??? ???? ?????? CLR ?? ?????? ?? ????? ???? ?? | CLR ????????? ?? ??????????? ??? ??? ??????? ?? ????? ???? ?? ?? ??????? ??????? ?????? ?????? ???? ?? ????: 1) ?????? ???????2) ????? ???????3) ??????? ???????4) ??? ???????5) ????????? ?? ???? ?????? ?????? ???????????? ?????????? ???????? ??? (MSIL):MSIL dks Microsoft Intermediate Language dgrs gSa ;k bls CIL (Common Intermediate Language Code) Hkh dgrs gSaA tc Hkh dotnet based programming language tks fd CLR dks target djrs gSaA muesa dksbZ izksxzke cuk;k tkrk gS ,oa mls compile fd;k tkrk gS rks source code dks machine code esa compile djus dh ctk; compiler bls MSIL esa a?????? djrk gSA ,slk djus ls Language interoperability fuf’pr gksrh gSA interoperability dk vFkZ gksrk gS ,d ls vf/kd ???????? ds chp ????? djus dh Lora=rkAvFkkZr MSIL ,d ,slk Intermediate Code gksrk gS tks dotnet based programming languages ds compilation ds ckn Generate gksrk gSA???? ?? ???? ???????? (Just In Time Compilers or JITers)?? IL ????????? ??? ?? ??????????? ???? ?? ???????? ???? ?? ?? CLR JIT ???????? ?? ??? ???? ?? ?? IL ??? ?? native executable (.exe or .dll) ??? ??? ????? ???? ?? OS ?? ??? ??????? ???? ?? |Executable Native CodeMSILCode in any .Net LanguageCompile Just in TimeCompiler????????? ????? ????????? Framework Class Library (FCL).??? ????????? ??, ??????? ??????? ?? ??? ????????? (?? ???) ????? ????????? (??????) ?? ????? ??? ?????? ???? ??? Class Library ;k dotnet Framework class library ckj&ckj ;wt fd;s tkus okys classes dk collection gksrk gS tks fd Common Language Runtime (CLR) ds lkFk fyad gksrk gSA Class object oriented gksrk gS ,oa mldk ;wt djds ge ???? ?????? ???? ?? ???????? ????????, ???? ???? ????????? ????? ??????, ???????, ?????, ??????????, ??????? ????????????, ?????? ????????????, ??? ????????????, ???? ??????, ?????, ??????, ??? ????????? rFkk ??? ???????? vkfn ?????? dj ldrs gSaA Class Library dk Extension .dll gksrk gSA Exe files dh rjg Class Library dks create djus ds ckn mlesa ???????? ugha dj ldrs gSaA ???? ???????? ???????????? (CLS)???????????? ?? ????????? ?? ?? ???? ?? ??? ?? ???? ???? ?? ?? ?? ?? .Net ?????? ???? ?? ??? ??? ?????? ??????? ???? ?? ??? ???????? ???? ?? ???? ???? ????? ????? ???? ?????? (CTS).??? ?? ???? ???? ?????? (??????) ?? ???????? ???? ??? CLS ?? ??? ?? ?????? ?? ?????? ?? ?? ??? ??? ?????? ???????? ???? ?????? ?? ???????? ???? ?? ?? ?? IL ????? ??? ???????? .??? ?????? ???? ?? ???? ???????? ???? ?????? ?? ?? ???? ???? ???????? ?? ?????? ???? ?????|?????? ??????? (GC)?????? ??????? ?? ?????? ?? ???? ???? ?? ?? ???? ?? ??????? ?????? ????? ??? ?? ?? ??? ??| ?????? ??????? ?? ?????? ?? ???????? ?????? ?? ???? ?? ???? ?? |.Net Framework ?? ????????? / Features of .Net Framework(1) Multi Language Development Environment: - .Net ,d ,slk plateform gS tgk? ij dbZ vyx&2 programming languages esa software applications dks develop dj ldrs gSaA ;g secure gksus ds lkFk&lkFk ,d ls vf/kd programming language ij odZ djus dh facility provide djrk gSA(2) Language Integration: - ;g .Net framework dk ,d ,slk feature gksrk gS ftldk ?????? djds different .Net supported programming languages esa applications dks develop dj ldrs gSaA dotnet framework esa dbZ programming languages dks integrate djds j[kk x;k gSA tSls& , C#, J#, etc.(3) Better Web Application Development :- Technology dk iz;ksx djds vklkuh ls ,oa Attrective Static ,oa Dynamic Websites create dj ldrs gSaA(4) Free AJAX [Asynchronous Javascript & XML) :- esa AJAX dk use djds web application speed dks vf/kd Fast dj ldrs gSa ,oa ;g fdlh browser ij work dj ldrk gSA(5) Secure Reliable Webservice: - Windows Communication Foundation (WCF) dkService Oriented Programming Model Framework ij cuk gqvk gS rFkkconnected system ds development dks vklku cukrk gSA blfy, .Net Framework esa Secure ,oa Reliable Web Service cukuk vklku gksrk gSA(6) Easy Deployment :- dotnet Framework esa develop fd;s gq, applications dks Deploy djuk vklku gksrk gSA(7) OOPs Support :- .Net Framework ???????? ???????? ???????????? ?? ??? ????????? ?? ?????? ???? ?? |(8)Multi Platform Application :- .NET ????????? ??? ??????????? (X86 ?? ??? X86) ?? ??????????? ?? ???? ?? |(9)Automatic Resource Management:- CLR ????? ?? ??? ????????? ???? ????, ??????, ??????? ??????? ??? ??????? ??????? ?? ??????? ???? ?? |(10)Multi Device Support:- .Net ????????? ??? ?????? ?? ??? ????????? ?????? ???? ?? ?????? ?????? ???? ?? |(11) Strong XML Support:- .Net ????????? ??????? ??? ??? ???????? ?? ??? XML ?????? ???? ?? ?????? ?????? ???? ?? | 2. Concept(i) GUIGUI ?? ????? ??? Graphical User Interface ???? ?? | ?? ???? ?? ??? ???????? ?? ????????? ?? ???????? ???? ?? ?? ????? ?? ?? ??????, ????? ??? ???? ?? ????? ???? ?? ??? ????? ????????? ???? ?? ???? ?? | ?? ?? ???????? ?? ???????? ??????? ?? ??????? ?? ?? ???? ?? ??????? ????????? ???? ?? ????? ?? ???? ?? ?????? ?? ???????? ?? ????? ??? ????? ???? ?? ?????? ???? ?? | GUI ?? ??? ??????? ?????? ???? ?? ????? ????? ???? ???? ?? ??? ???? ?? | ?? ??????? ??????????? ????????? ??????????? ?????? ?????? ???? ???? ?? | ?????? ????????? ?? ???? ?? ???????? ???? ?? ??? ???? ?? ??????? ?? ????? ?? ??? GUI ?? ?????? ??? | ?????????? ?? .NET ????????? ?? ?????? ????? ?????? ?? ????????? ??????? ?????? ???? ???:??Web Forms??Windows Forms??Web Services Event Driven Programming or Event Based Programming????? ??????? ???????????? ?? ????? ????? ???????????? ?? ???????????? ???? ?? ????? ????????? ?? ???? ????? ?? ???? ?? ????? (???? ?????, ?? ?????) ?? ?????? ????????? ???? ???? ?? | ???????????? ?? ?? ?????? ?? ???? ??????? ?? ???? ????? ?? ???? ???? ?? ??????????? ???? ?? | ,slh programming language ftuds source code event ds pyus ls execute gksrs gSaA mUgsa Event driven programming dgrs gSaA Event driven programming ij based gksrh gSA blesa source code events ds pyus ls execute gksrk gS ftlls bldh LihM QkLV gksrh gS tcfd C & C++ esa cuk;s x;s programs event driven de based ugha gksrs gSaA buesa tSls gh izksxzke dks ju fd;k tkrk gS mlesa fy[ks lkslZ dksM ,d&,d djds Execute gksus yxrs gSaA ysfdu esa Source Code Events ds Base ij Execute gksrk gSA GUI Programming esa Mouse ,oa Keyboard events dk mi;ksx lcls T;knk fd;k tkrk gSAEvents :-(1) Mouse Events(2) Keyboard Events(3) Focus Event(4) Load Event(1) Mouse Event :- bl izdkj ds Event mouse device dh lgk;rk ls pyk;s tkrs gSaA GUIProgramming esa Mouse Events dk mi;ksx vf/kd fd;k tkrk gSA Mouse Event ds varxZr fuEu Events vkrs gSa &(a) Click :- ;g Event mouse ds Left ;k Right button dks press djus ij Execute gksrk gSA(b) Double Click :- ;g Mouse ds Left button dks nks ckj press djus ij Execute gksrk gSA(c) Mouse up :- ;g Event mouse ds button dks up djus ij Execute gksrk gSA(d) Mouse Down :- ;g Click event dh rjg gksrk gS ,oa ekml ds Left or Right button dksdown djus ij Execute gksrk gS ysfdu blesa press fd;s x;s button dh value izkIr gksrhgSA(e) Mouse Click :- ;g Events dsoy Mouse ls fDyd djus ij Execute gksrk gSA(f) Mouse Enter :- ;g control ij ekml dks Enter djus ij Execute gksrk gSA(2) Keyboard Event :- bl izdkj ds Event keyboard device dh lgk;rk ls pyk;s tkrs gSaA ;s fuEu izdkj ds gksrs gSa&(a) Keypress(b) Keyup(c) Keydown(a) Keypress :- ;g Event keyboard ls key dks press djus ij Execute gksrk gSA ysfdu ;gdsoy dqN Keys ds fy;s gh dk;Z djrk gSA tSls& alphabet keys, Numeric Keys, Special keys.(b) Keyup :- ;g Keyboard ls fdlh Hkh press fd, gq, cVu dks up djus ij Execute gksrk gSA(c) Keydown :- ;g keyboard ls fdlh Hkh Key dks down djus ij execute gksrk gS ysfdu blesa down dh xbZ key dk Code No. Hkh izkIr gksrk gSA(3) Focus Event :- ;g Keyboard ,oa ekml nksuksa dh lgk;rk ls Execute fd;s tk ldrs gSaA Focus ds varxZr Got Focus ,oa Last Focus vkrs gSaA Gotfocus fdlh Control ij Focus ds igqapus ls Execute gksrk gS tcfd Lost Focus Control ls Cursor ds gVus ij Execute gksrk gSA(4) Load :- ;g fdlh Hkh daV?ksy ds Load gksus ij Execute gksrk gSA3. IDE (Integrated Development Environment)IDE dks Integrated Development Environment dgrs gSaA ;g ,d ,slk Environmentcukdj nsrk gS tks izksxzkfeax dks izksxzke develop vkSj Execute djus esa Help djrk gSA IDE ,d ,slkEnvironment cukdj nsrk gS ftlesa izksxzke develop djus ds fy, lHkh Components available gksrs gSaA esa izksxzke cukus ds fy, Different components dh vko’;drk gksrh gSA IDE esa lHkh components ;k tools ,d gh txg provide djrk gSA bu Components ds varxZr Toolbox, solution-explorer, properties window, menubar, toolbar vkfnA IDE ds componets dks resize djus ij mlls tqM+s lHkh components automatic resize gksrs gSaAComponents of IDE :-(a) Tool box(b) Solution Explorer(c) Form Designer(d) Properties window(e) Menu bar(f) Toolbar(g) Object Browser(h) Server Explorer(i) Error List etc.(a) Tool Box :- ;g GUI Applications ds fy, lcls T;knk ;wt gksus okyk component gSA ;g IDE ds Left side esa display gksrk gSA blds vykok bls view menu ls Toolbox option ij fDyd djds Hkh izkIr dj ldrs gSaA Toolbox esa igys ls cus gq, daV?ksYl tSls& Textbox, Buttons vkfn izkIr gksrs gSaA blesa controls dbZ tabs esa category ds vuqlkj arrange gksrs gSa tSls& Common controls, containers, Menus & Toolbar, Data, Component, Printing etc.(b) Solution Explorer :-;g IDE ds Right side esa display gksrk gSA blds vykok bls view menu ls solution explorer option ij fDyd djds Hkh display dj ldrs gSaA ;g solution ,oa mlds izkstsDV~l rFkk izkstsDV~l ds Items dks fMLIys djrk gSA solution ds vUnj ,d ls vf/kd vkbVEl ;k QkeZ gks ldrs gSaA Solution Explorer solution rFkk project ds vanj ;wt fd;s tkus okys References, Data Collections, Folders rFkk Files dks contain djrk gSASolution Explorer ls Files dks Open djds Edit dj ldrs gSaA Project ls ubZ QkbZy dks Add dj ldrs gSa rFkk Solution, project rFkk Items dh Property dks ns[k ldrs gSaA(c) Form Designer Window :-;g lcls Important component gksrk gSA bldh lgk;rk ls Application dk user interface rS;kj fd;k tkrk gSA ;g fdlh Hkh Application dk GUI interface cukus esa enn djrk gSA esa Windows application ds fy, ;g ,d base gksrk gSA bls fMtkbZu djus ds fy, toolbox ds different tools ;k daV?ksy dk ;wt fd;k tkrk gSA bldk Extension .Vb gksrk gSA(d) Property Window :-Property window IDE ds Right side display gksrk gSA blds vykok bls view menu ls property window ;k F4 shortcut key press djds Hkh fMLIys dj ldrs gSaA blds vanj selected object dh Properties ,oa Events display gksrs gSaA Properties window ds vUnj properties ds uke ,oa mudh values display gksrh gSA Properties windows ls fdlh Hkh property dh value dks change dj ldrs gSa ysfdu dqN property dsoy read only gksrh gS ftUgsa change ugha dj ldrs gSaA(e) Code Window or Code Editor :- bls view code window ds uke ls Hkh tkuk tkrk gSA ;g IDE dk Work Processor gksrk gSA blds vanj Controls ds Events ds fy, code fy[ks tkrs gSaA Code ges’kk Procedure Block ds vUnj fy[kk tkrk gSA Source code window esa tkus ds fy, view menu ls view code ;k property window ls view code option ij fDyd djrs gSaA blds vykok code window dks Form ;k fdlh Object ds ?ij double click djds Hkh vksiu dj ldrs gSaA(f) Menu Bar :- Menu bar fdlh Hkh GUI Itegrated development environment dh rjg esa common component gksrk gSA Menu bar ges’kk windows ds ?ijh fgLls esa Title bar ds uhps display gksrk gSA es dk;Z djrs le; fofHkUu izdkj ds dek.M~l dh vko’;drk gksrh gS ftUgsa Menu bar ls Execute djrs gSaA tSls& New Project Create djuk] Project Save djuk] Open djuk] Run djuk vkfnA(g) Tool Bar :- ;g IDE dk ,d ,slk component gksrk gS ftldk ;wt djds Menu bar dhdek.M~l dks pyk;k tkrk gSA Toolbar esa Menu bar dh mUgha dek.M~l dks j[kk tkrk gS ftudk ;wt T;knk fd;k tkrk gSA Bydefault esa Standard Toolbar display gksrk gS ysfdu ge view menu ls vU; Toolbar dks Hkh display dj ldrs gSaA(h) Object Browser :- bls view menu ls Object browser option ij fDyd djds fMLIys dj ldrs gSaA ;g different objects dh properties, methods vkfn dks fMLIys djrk gSA blesa ds lHkh components dks display djrk gSA blesa ogh object display gksrs gSa tks ds lkFk built in vkrs gSaAObject Browser esa rhu pane gksrs gSaA blds ck;ha vksj Object Pane rFkk nk;ha vksj ?ij okyk pane member pane gksrk gS ,oa uhps okyk description pane gksrk gSA(i) Server Explorer :- ;g IDE ds left side display gksrk gSA blds vykok bls view menu ls server explorer option ij fDyd djds Hkh fMLIys dj ldrs gSaA Server Explorer dk ;wt usVodZ ds Server ij miyC/k data link, database connection rFkk system resources dks ns[kus ,oa muds lkFk work djus ds fy, fd;k tkrk gSA Server Explorer dk ;wt djds fdlh Hkh data connection dks open dj ldrs gSa rFkk delete dj ldrs gSaA(j) Error List :- ;g IDE ds uhps dh rjQ fMLIys gksrk gSA blds vykok bls view menu ls Errorlist option ij fDyd djds Hkh fMLIys dj ldrs gSaA ;g dksM ds compilation ,oa edit ds nkSjku gksus okyh Errors, warning vkfn dks fMLIys djrk gSA blds vykok bldh lgk;rk ls system errors dks Hkh <wa<+ ldrs gSAError list esa display gksus okyh errors ij double click djds mls LFkku ij tk ldrs gSa tgk? error gS ,oa mls Bhd dj ldrs gSaA tSls gh fdlh Error dks Bhd fd;k tkrk gS og error list ls gV tkrh gSA(k) Output Window :- Output window Hkh IDE ds uhps dh rjQ fMLIys gksrh gSA blds vykok bls view menu ls output window option ij fDyd djds Hkh fMLIys dj ldrs gSaA ;g IDE ds dbZ features ds fy, status messages fMLIys djrk gSA 4. Windows Form ?????? ??????????? ????? ?? ????????? ??? ????? ???? ???? ????? ?? ????????? ???? ?? | ?????? ????? ?? ?????? ?? ???? ?? ????? ???? ??? ???? ?? ???????? ???? ?? ??? ???? ???? ?? | ?????? ????? System.Windows.Forms.Form ????? ?? ?????? ?? ??????? ???? ???? ?? | Form ????? System.Windows.Forms ???????? ??? ?????? ?? | System.Windows.Forms namespace ?? ????? ???? ?? class ???? ?? ??? ???? ????? ???????????, ???????, ????? ??? ?????? ????? ??????? ???? ?? ??? ???? ???? ?? | bls Form Designer Window Hkh dgrs gSaA ;g esa ,d root container dh rjg behave djrk gS ftldk ;wt djds user interface screen dks design fd;k tkrk gSA esa bldk extension .Vb gksrk gSA bl foaMks dk ;wtj vius vuqlkj fMtkbZu dj ldrk gSA bls fMtkbZu djus ds fy, toolbox ds different controls dk ;wt fd;k tkrk gSA tc Hkh esa Windows Application dks Run fd;k tkrk gS rks ;g Form control gh run gksrk gSA Form ds lkFk different types dh properties, methods, ,oa Events use fd;s tkrs gSaAWindows Forms Events?? ???? ??? ?? ????? ??????? ???? ?? ?? ????? ??????? ???? ?? | ???? ???? ?? ????? ???? | ?????? ?? ???, ?? ?? ?????????? Windows ????? ?? ???? ????? ???? ??, ????? ????? ??????? ???? ??? Windows ????? ?? ????? ?? ??? ??????? ???? ???? ??????? ?????? ???? ??? ? ?? ?? ????? ???? ???? ?? ?? ?? ???? ????????? ?? instruct ???? ?? ??? ??? ??? ???? ??? |?? Windows ????? ?? ??? ??????? ??? ??????? ?? ???? ???????? ?? ??? ????1. Activated: ?? ????? ?? ???? ?? ?? ????? ?? ??? ??? ???????? ???? ???? ?? ?? ???? ?? ?????? ???? ???? ?? |2. Click: ?? ????? ?? ???? ???? ?? ?? ???? ????? ?? ?? ????? ??? ???? ??????? ?? ????? ???? ?? 3. Deactivate: ?? ????? ?? ???? ?? ?? ????? ???? ???? ?? ???? ?? ?? ?????? ??? ??? ???? ???? ???4. FormClosed: ?? ????? ?? ???? ?? ?? ????? ??? ?? ???? ???? ?? | 5. FormClosing: ?? ????? ?? ???? ?? ?? ????? ??? ???? ?? ??? ?? |6. Load: ????? ?? ???? ??? ???????? ???? ?? ???? ?? ????? ???? ?? |7. MouseDown: ?? ????? ?? ???? ?? ?? ???? ?? ????? ??? ????? ?? ????? ???? ???? ?? |8. MouseMove: ?? ????? ?? ???? ?? ?? ???? ?? ????? ?? ??? ???? ???? ?? |9. MouseUp: ?? ????? ?? ???? ?? ?? ???? ??? ?? ?????? ????? ?? ????? ???? ???? ?? | 10. Move: ?? ????? ?? ???? ?? ?? ????? ?? ??? ???? ???? ?? |Windows Form Properties?????????? ????? ?????? ???? ?? ????? ?? ????????? ??? ???? ?? ?????? ???? ?? | ?????????? ????? ????? ?? ?????????? ???????? ???? ?? | ????? ?? ??? ?????????? ?? ?????? ??? |AcceptButton:- ????? ?? ??? ?? ??? ???? ??? Enter key ?? ????? ???? ???? ?? |AutoScroll:- ?? ??????? ??? ?? ????: ?? ?????? ?? ?? ????? ?? ?????? ?????? ????? ?? ??? ???? ?? |(3) BackColor :- bl properties dk ?????? Form dk background color change djus ds fy, fd;k tkrk gSABackcolor=Blue(4)BackgroundImage: bl property dk ?????? Form dh background image change djus ds fy, fd;k tkrk gSA(5) BackgroundImageLayout:- bl property dk ?????? background image ?? ????? ?? ??? ???? ?? ??? ???? ???? ?? | BackgroundImageLayout ?? ??????? Tile, Center, Stretch, Zoom ???? ??? |(6) Cursor:- ????? ???? ?? ??? ???? ?? ???? ????? ?? ??? ???? ?? |(7) ControlBox :- Control Box dks show ,oa hide djus ds fy, bl izkiVhZ dk ?????? fd;k tkrk gSA Bydefault ;g true gksrh gSAControlBox=True(8) Enabled :- bl properties dk ;wt Form dks Enable ;k Disable djus ds fy, fd;k tkrk gSA ;fn Form disable gksrk gS rks Form ,oa mlds control dk;Z ugha djrs gSA Bydefault ;g True gksrh gSAEnabled=True(9) Font:- ????? ??? font ??? ???? |(10) ForeColor :- Form dk foreground color set djus ds fy, bl izkiVhZ dk ;wt fd;k tkrk gSA Forecolor=Red(11) FormBorderStyle: bl property dk ;wt ????? ?? ?????? ?????? ??? ???? ?? ??? ???? ???? ?? |(12) Icon: property ????? ????? ?? ????? ??? ?? ????? ?? ??? ???? icon ?? ????????? ???? ?? |(13) IsMDIChild: ?? ????????? ????????? ???? ?? ?? ????? Multiple Document Interface (MDI) child ????? ?? ??? ?????? ?? ?? ??? |(14) Location:- bl property dk ;wt ????? ?? Location ??? ???? ?? ??? ???? ???? ?? | (15) Locked:- ?? ????????? ????????? ???? ?? ?? ????? ?? ??? ?? ?????? ???? ?? ???? ?? |(16) MaximizeBox :- Form ds caption bar esa display gksus okys Maximize box dks Enable or Disable djus ds fy, bl izkiVhZ dk ;wt fd;k tkrk gSAMaximizeBox=True(17) MinimizeBox :- Form ds Caption bar esa fMLIys gksus okys minimize button dksEnable/Disable djus ds fy, bldk ;wt fd;k tkrk gSAMinimizeBox=True(18) Text :-bl izkiVhZ dk mi;ksx Form control ds title bar esa display gksus okys text dks lsV djus ds fy, fd;k tkrk gSAText=Welcome(19) WindowState :-Form dh Window State dks lsV djus ds fy, bl izkiVhZ dk ;wt fd;k tkrk gSAtSls& minimize, maximize, etc.WindowState=MaximizeWindows Form MethodsShow () bl eSFkM dk mi;ksx Form dks show djus ds fy, fd;k tkrk gSA[FormName].show ()Frm.show ()Me.show ()Hide () :- Form dks hide djus ds fy, bl eSFkM dk ;wt fd;k tkrk gSA[FormName].Hide ()Frm.Hide ()Me.hide ()Example:Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.ClickDisplayForm.Show()End SubPrivate Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.ClickDisplayForm.Hide()End SubEnd Class3. Activate: ?? ???? ????? ?? ???????? ???? ?? ??? ????? ?? ???? ???? ?? | Syntax:Form1.Activate()4. Close: bl method dk mi;ksx Form dks Close djus ds fy, fd;k tkrk gSASyntax:[FormName].Close()Form1.Close ()5. ShowDialog: Form dks ,d modal dialog box dh rjg show djrk gSASynatx:[FormName].showDialog ()Form1.ShowDialog()6. Focus: bl method dk mi;ksx Form ?? ??????? ??? ????? ???? ??? ???? ?? ??? ???? ???? ?? | Synatx:Form1.focus()7. ResetText: This method is used to resets the Text property to its default value. ?? ???? ????? ?? ??????? ????????? ?? ??????? ?????? ??? ???? ?? |Syntax:[FormName].ResetText()Form1.ResetText()5. Intrinsic Controls???????? ??? ????????? ????? ???? ???? ????????? Intrinsic Controls ?????? ??? | ?? ??????? ?????? ????? ??? ???????? ???? ?? ????? ????? ???? ?? ????? ?? ???? ???????? ???? ?? ??? ???? ???? ?? |?????? ????? ??????? ?????? ?? ??????? ?? ?????? ???? ?? | ??????? ?? ??????????, ?????? ??? ??????? ???? ??? ????? ????? ??????? ????? ???? ?? ??? ???? ???? ?? |Label:Label ??????? ?? ????? ??????? ?? ???????? ???? ?? ??? ???? ???? ?? ???? ?????? ?? ????????? ??? ???? ?? ???? ?? |Label ??????? ?? ??????????AutoSize: ?? ?????????? ?? ????????? ???? ?? ?? Label ?? ???? ????? ?? ??????? ?? ???? ?? ?????? ???? |BackColor: BackColor ????????? ?? ?????? Label ?? ?????????? ??? ??? ???? ?? ??? ???? ???? ?? | BorderStyle: ?? ????????? ?? ?????? ????? ?? ?????? ?????? ?? ??? ???? ?? ??? ???? ???? ?? |Cursor: ????? ???? ?? ??? ???? ?? ???? Label ?? ??? ???? ?? |Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ??? |FlatStyle: ?? ?????????? Label ?? appearance ?? ??? ???? ?? |Font: ????? ?????? ??? ???? ?? ??? ???? ???? ?? ???? ????? ?? ???, ?????? ??? ???? ??????? |ForeColor:. ?? ????????? ?? ?????? Label ?? forground color (??????? ?? ???) ??? ???? ?? ??? ???? ???? ?? |Image: ?? ????????? ?? ?????? ???? ?? ??? ???? ?? ??? ???? ???? ?? |ImageAlign: ?? ????????? ?? ?????? ???? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Location: ?? ????????? ????? ?? Label ?? starting position ??? ???? ?? ??? ???? ???? ?? |Locked: ?? ????????? ????????? ???? ?? ?? Label ?? ??? ?? ?????? ???? ?? ???? ?? |Size:. ?? ????????? ?? ?????? Label ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? | Text: ?? ????????? ?? ?????? Label ?? ??????? ?? ??? ???? ?? ??? ???? ???? ?? |TextAlign: ?? ????????? ?? ?????? Label ?? ??????? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Visible: ?? ????????? ????????? ???? ?? ?? Label visible ?? ?? hidden ?? |Button:Button ??????? ?? ????? ????? ?? ??????? ???? ?? ??? ???? ???? ?? ?? Button ?? ????? ???? ???? ?? |Button ??????? ?? ??????????:AutoSize: ?? ?????????? ?? ????????? ???? ?? ?? Button ?? ???? ????? ?? ??????? ?? ???? ?? ?????? ???? |BackColor: BackColor ????????? ?? ?????? Button ?? ?????????? ??? ??? ???? ?? ??? ???? ???? ?? | BackgroundImage: bl property dk ?????? Button dh background image change djus ds fy, fd;k tkrk gSABackgroundImageLayout:- bl property dk ?????? background image ?? ????? ?? ??? ???? ?? ??? ???? ???? ?? | BackgroundImageLayout ?? ??????? Tile, Center, Stretch, Zoom ???? ??? |Cursor: ????? ???? ?? ??? ???? ?? ???? Button ?? ??? ???? ?? |Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ??? |FlatStyle: ?? ?????????? Button ?? appearance ?? ??? ???? ?? |Font: ????? ?????? ??? ???? ?? ??? ???? ???? ?? ???? ????? ?? ???, ?????? ??? ???? ??????? |ForeColor:. ?? ????????? ?? ?????? Button ?? foreground color (??????? ?? ???) ??? ???? ?? ??? ???? ???? ?? |Image: ?? ????????? ?? ?????? ???? ?? ??? ???? ?? ??? ???? ???? ?? |ImageAlign: ?? ????????? ?? ?????? ???? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Location: ?? ????????? ????? ?? Button ?? starting position ??? ???? ?? ??? ???? ???? ?? |Locked: ?? ????????? ????????? ???? ?? ?? Button ?? ??? ?? ?????? ???? ?? ???? ?? |Size:. ?? ????????? ?? ?????? Button ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? | Text: ?? ????????? ?? ?????? Button ?? ??????? ?? ??? ???? ?? ??? ???? ???? ?? |TextAlign: ?? ????????? ?? ?????? Button ?? ??????? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Visible: ?? ????????? ????????? ???? ?? ?? Button visible ?? ?? hidden ?? |Checkbox Checkbox ,d ,slk daV?ksy gksrk gS ftldk mi;ksx multiple options esa ls ,d ;k ,d ls vf/kd ;k fQj lHkh options dks select djus ds fy;s fd;k tkrk gSA ;g control checkbox class ij based gksrk gS rFkk checkbox class control class ij based gksrh gSA Checkbox daV?ksy ??? ???????? ????? ??? ?????? ??? ?? | tc Hkh checkbox dks psd fd;k tkrk gS rks ??? ????? ????? ???? ?? ??? bldh checked property esa true assign gksrk gSA Checkbox ds lkFk different properties, methods ,oa events use fd, tkrs gSaASome Common Propertise of Checkbox :-Appearance :- Checkbox ds Appearance dks lsV djus ds fy, bl izkiVhZ dk ;wt fd;k tkrkgSAAutoCheck: ?? ????????? ?? ?? Checkbox ????? ?? ???? ????? ???????? ?? ???? ?? ?? ?? ?? ????? ???? ???? ?? | AutoSize: ?? ????????? ?? Checkbox ?? ???? ????? ?? ??????? ?? ???? ?? ?????? ???? |BackColor: ?? ????????? ?? Checkbox ?? ?????????? ??? ??? ?? ???? ??? | BackgroundImage: bl property dk ?????? Checkbox dh background image change djus ds fy, fd;k tkrk gSABackgroundImageLayout:- bl property dk ?????? background image ?? ????? ?? ??? ???? ?? ??? ???? ???? ?? | CheckAlign: ?? ????????? Checkbox ?? ?????? ????????? ???? ?? | Checked: ;g izkiVhZ ????? gS fd Checkbox checked state esa gS ;k ughaACursor: ????? ???? ?? ??? ???? ?? ???? Checkbox ?? ??? ???? ?? |Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ??? |FlatStyle: ?? ?????????? Checkbox ?? appearance ?? ??? ???? ?? |Font: ????? ?????? ??? ???? ?? ??? ???? ???? ?? ???? ????? ?? ???, ?????? ??? ???? ??????? |ForeColor:. ?? ????????? ?? ?????? Checkbox ?? foreground color (??????? ?? ???) ??? ???? ?? ??? ???? ???? ?? |Image: ?? ????????? ?? ?????? ???? ?? ??? ???? ?? ??? ???? ???? ?? |ImageAlign: ?? ????????? ?? ?????? ???? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Location: ?? ????????? ????? ?? Checkbox ?? starting position ??? ???? ?? ??? ???? ???? ?? |Locked: ?? ????????? ????????? ???? ?? ?? Checkbox ?? ??? ?? ?????? ???? ?? ???? ?? |Size:. ?? ????????? ?? ?????? Checkbox ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? | Text: ?? ????????? ?? ?????? Checkbox ?? ??????? ?? ??? ???? ?? ??? ???? ???? ?? |TextAlign: ?? ????????? ?? ?????? Checkbox ?? ??????? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Visible: ?? ????????? ????????? ???? ?? ?? Checkbox visible ?? ?? hidden ?? |??????: Checkbox ?? ????????? Private sub Chk1_checkchanged()Me.BackColor = Color.RedEnd SubPrivate sub Chk2.checkchanged ()Me.BackColor = Color.greenEnd SubPrivate sub Chk3_checkchanged ()Me.BackColor = Color.pinkEnd SubRadio Button :-Radio button dks option button Hkh dgrs gSaA bl daV?ksy dk ;wt multiple options esa ls fdlh ,d vkWI’ku dks lysDV djus ds fy, fd;k tkrk gSA ;g control Radio button class ij based gksrk gSA tc Hkh fdlh Radio button dks check fd;k tkrk gS rks bldh checked property esa true assign gksrk gS vU;Fkk False assign jgrk gSA ;fn ,d lkFk ,d gh foaMks esa nks jsfM;ks cVu dks lysDV djuk gS rks Groupbox ;k Panel dk ;wt fd;k tkrk gSA Radio button ds lkFk different properties, methods ,oa events use fd;s tkrs gSaAAutoCheck: ?? ????????? ?? ?? Radio Button ????? ?? ???? ????? ???????? ?? ???? ?? ?? ?? ?? ????? ???? ???? ?? | AutoSize: ?? ????????? ?? Radio Button ?? ???? ????? ?? ??????? ?? ???? ?? ?????? ???? |BackColor: ?? ????????? ?? Radio Button ?? ?????????? ??? ??? ?? ???? ??? | BackgroundImage: bl property dk ?????? Radio Button dh background image change djus ds fy, fd;k tkrk gSABackgroundImageLayout:- bl property dk ?????? background image ?? ????? ?? ??? ???? ?? ??? ???? ???? ?? | CheckAlign: ?? ????????? Radio Button ?? ?????? ????????? ???? ?? | Checked: ;g izkiVhZ ????? gS fd Radio Button checked state esa gS ;k ughaACursor: ????? ???? ?? ??? ???? ?? ???? Radio Button ?? ??? ???? ?? |Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ??? |FlatStyle: ?? ?????????? Radio Button ?? appearance ?? ??? ???? ?? |Font: ????? ?????? ??? ???? ?? ??? ???? ???? ?? ???? ????? ?? ???, ?????? ??? ???? ??????? |ForeColor:. ?? ????????? ?? ?????? Radio Button ?? foreground color (??????? ?? ???) ??? ???? ?? ??? ???? ???? ?? |Image: ?? ????????? ?? ?????? ???? ?? ??? ???? ?? ??? ???? ???? ?? |ImageAlign: ?? ????????? ?? ?????? ???? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Location: ?? ????????? ????? ?? Radio Button ?? starting position ??? ???? ?? ??? ???? ???? ?? |Locked: ?? ????????? ????????? ???? ?? ?? Radio Button ?? ??? ?? ?????? ???? ?? ???? ?? |Size:. ?? ????????? ?? ?????? Radio Button ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? | Text: ?? ????????? ?? ?????? Radio Button ?? ??????? ?? ??? ???? ?? ??? ???? ???? ?? |TextAlign: ?? ????????? ?? ?????? Radio Button ?? ??????? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Visible: ?? ????????? ????????? ???? ?? ?? Radio Button visible ?? ?? hidden ?? |ComboBox:ComboBox ??????? ?? ?????? ??????? ???? ?? ????? ???????? ???? ?? ??? ???? ???? ?? | ?? textbox ??? drop-down list ?? ?????????? ???? ?? | Textbox ????? ???? ???? enter ?? ???? ?? ?? drop-down list ????? ?? ???? ???? ??????? ?? ???? ?? | ;g ;wtj dks vius vkWI’ku dks ;k rks mUgsa type djds ;k fQj Listbox ls Select djus dh Facility provide djrk gSAProperties of the ComboBox ControlBackColor: ?? ????????? ?? ComboBox ?? ?????????? ??? ??? ?? ???? ??? | Cursor: ????? ???? ?? ??? ???? ?? ???? ComboBox ?? ??? ???? ?? |DataSource: ?? ????? ?? ????? ???? ?? ?? ?? ??????? ???? ???? ??????? ???? ?? ??? ????? ????? |DisplayMember: ?? ????????? ?? ????? ???? ?? ?? ComboBox ??? ???? ?? ??? ????????? ???? ?? ??? ???? ?? |DropDownStyle: ?? ComboBox ?? appearance ??? functionality ?? ??????? ???? ?? | bl izkiVhZ dk ;wt Combobox dk style set djus ds fy;s fd;k tkrk gSA tSls& simple, dropdown, dropdown list.Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ??? |FlatStyle: ?? ?????????? ComboBox ?? appearance ?? ??? ???? ?? |Font: ????? ?????? ??? ???? ?? ??? ???? ???? ?? ???? ????? ?? ???, ?????? ??? ???? ??????? |ForeColor:. ?? ????????? ?? ?????? ComboBox ?? foreground color (??????? ?? ???) ??? ???? ?? ??? ???? ???? ?? |FormatString: ?? format-specifier character ?? ??? ???? ?? ?? ?? ????? ???? ?? ?? ?????? ???? ????????? ?? ???? ?? |Items:. ComboBox ??? ????? Item ?? ?????? ?? ???????????? ???? ?? | Location: ?? ????????? ????? ?? ComboBox ?? starting position ??? ???? ?? ??? ???? ???? ??|Locked: ?? ????????? ????????? ???? ?? ?? ComboBox ?? ??? ?? ?????? ???? ?? ???? ?? |Size:. ?? ????????? ?? ?????? ComboBox ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |Sorted: ?? ????????? ??? ???? ?? ?? ComboBox ??? ???? ?????????? ??? ?? ???? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? | Text: ?? ????????? ?? ?????? ComboBox ?? ??????? ?? ??? ???? ?? ??? ???? ???? ?? |Visible: ?? ????????? ????????? ???? ?? ?? ComboBox visible ?? ?? hidden ?? |ListBox:?? ComboBox ??????? ?? ????? ???? ?? | ;g Control Items dh List dks display djus ds fy;s ;wt fd;k tkrk gS ftlesa ls ge fdlh Hkh Item dks select dj ldrs gSaA ;wtj pkgs rks listbox ls dsoy ,d ;k ,d ls vf/kd vk;Ve dks Hkh Select dj ldrk gSA blds lkFk different properties, methods ,oa Events use fd;s tkrs gSaAProperties of the ListBox ControlBackColor: ?? ????????? ?? ListBox ?? ?????????? ??? ??? ?? ???? ??? | BorderStyle: ?? ????????? ?????? ?? ?????? ??? ???? ??|Cursor: ????? ???? ?? ??? ???? ?? ???? ListBox ?? ??? ???? ?? |DataSource: ?? ????? ?? ????? ???? ?? ?? ?? ??????? ???? ???? ??????? ???? ?? ??? ????? ????? |DisplayMember: ?? ????????? ?? ????? ???? ?? ?? ListBox ??? ???? ?? ??? ????????? ???? ?? ??? ???? ?? |Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ??? |Font: ????? ?????? ??? ???? ?? ??? ???? ???? ?? ???? ????? ?? ???, ?????? ??? ???? ??????? |ForeColor:. ?? ????????? ?? ?????? ListBox ?? foreground color (??????? ?? ???) ??? ???? ?? ??? ???? ???? ?? |FormatString: ?? format-specifier character ?? ??? ???? ?? ?? ?? ????? ???? ?? ?? ?????? ???? ????????? ?? ???? ?? |Items: ListBox ??? ????? Item ?? ?????? ?? ???????????? ???? ?? | Location: ?? ????????? ????? ?? ListBox ?? starting position ??? ???? ?? ??? ???? ???? ?? |Locked: ?? ????????? ????????? ???? ?? ?? ListBox ?? ??? ?? ?????? ???? ?? ???? ?? |ScrollAlwaysVisible: ?? ????????? ?? ?????? ListBox ??? ??????? ??? ????? ?????? ?? ??? ???? ???? ??|SelectionMode: ?? ????????? ?? ????????? ???? ?? ?? ListBox ??? ???? ?? ??? ?????? ???? ?????? | Size:. ?? ????????? ?? ?????? ListBox ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |Sorted: ?? ????????? ??? ???? ?? ?? ListBox ??? ???? ?????????? ??? ?? ???? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? | Text: ?? ????????? ?? ?????? ListBox ?? ??????? ?? ??? ???? ?? ??? ???? ???? ?? |Visible: ?? ????????? ????????? ???? ?? ?? ListBox visible ?? ?? hidden ?? |ScrollBars:ScrollBar ????? ?? ??????? ??? ????????? ??????? ??? ?? ????????? ???? ?? | windows application esa scrollbar dk ;wt ist dks ?ij uhps ;k Left – Right move djus ds fy;s fd;k tkrk gSA blds vykok Scrollbar dk ;wt sound dks increase, decrease djus] color contrast dks increase/decrease djus vkfn odZ djus ds fy;s fd;k tkrk gSA Scrollbar esa Scrollbox gksrk gS ftls ekml dh lgk;rk ls vkxs&ihNs fd;k tk ldrk gSA tc Hkh Scrollbar dks Scroll fd;k tkrk gS rks bldh value property change gksrh gSA bl value dk ;wt ,slh txg dj ldrs gSa tgk? Increment ;k decrement dh vko’;drk gksrh gSA esa Horizontal ,oa Vertical Scrollbar ik, tkrs gSaA Scrollbar, Scrollbar class ij based gksrk gS rFkk scrollbar class control class ij based gksrh gSA Scrollbar ds lkFk different properties, methods ,oa events use fd;s tkrs gSaAProperties of HScrollBar and VScrollBarCursor: ????? ???? ?? ??? ???? ?? ???? Scrollbar ?? ??? ???? ?? |Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ???|LargeChange: ?? ?? amount ?? ????? ???? ?? ?? ???? ??????? ??? ??? PAGE UP ?? PAGE DOWN ????? ?? ????? ???? ?? ?? ??????? ????? ?? ?????? ????????? ???? ??| Location: ?? ????????? ????? ?? ListBox ?? starting position ??? ???? ?? ??? ???? ???? ?? |Locked: ?? ????????? ????????? ???? ?? ?? ListBox ?? ??? ?? ?????? ???? ?? ???? ?? |Maximum: bl izkiVhZ dk ;wt Scrollbar dh maximum value set djus ds fy;s fd;k tkrk gSAMinimum: bl izkiVhZ dk ;wt Scrollbar dh minimum value set djus ds fy;s fd;k tkrk gSASmallChange: ?? ?? amount ?? ????? ???? ?? ?? ???? ??????? Arrow ??? Arrow ????? ?? ????? ???? ?? ?? ??????? ????? ?? ?????? ????????? ???? ??| Size:. ?? ????????? ?? ?????? Scrollbar ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? | Value: ;g izkiVhZ Scrollbar dh current position dks indicate ???? gSAVisible: ?? ????????? ????????? ???? ?? ?? Scrollbar visible ?? ?? hidden ?? |TextBox:;g windows application dk lcls common control gksrk gSA bldk ;wt ;wtj ls value input djkus ,oa value display djkus ds fy, fd;k tkrk gSA ;g Textbox Class ij based gksrk gS rFkk textbox control class ij based gksrk gSA Bydefault ;g maximum 2048 character rd dk MkVk accept djrk gS ysfdu multiline property ds true gksus ij 32 kb rd dk MkVk input dj ldrs gSaA textbox dks password box dh rjg Hkh ;wt dj ldrs gSaA gSaA By default, ?? TextBox ??????? ?? ????? ???? ??? ???????? ???? ?? | ??? ?? ?? ?? ???? ???? ??? ??????? ?? ???????? ???? ????? ?? ?? ???? MultiLine property ?? True ???? ???? | blds fy, passwordchar property dk ;wt fd;k tkrk gSA Textbox ds lkFk different properties , methods ,oa events use fd, tkrs ??|Properties of the TextBox ControlBackColor: ?? ????????? ?? TextBox ?? ?????????? ??? ??? ?? ???? ??? | BorderStyle: ?? ????????? ?????? ?? ?????? ??? ???? ??|Cursor: ????? ???? ?? ??? ???? ?? ???? TextBox ?? ??? ???? ?? |Dock: ?? ?????????? ?? ????????? ???? ?? ?? ??? ?? ?????? ?????? ?? ????? ?? |Enabled: ?? ?????????? ?? ????????? ???? ?? ?? ?? ???? ??????? ??????? ?? respond ???? ?? ?? ??? |Font: ????? ?????? ??? ???? ?? ??? ???? ???? ?? ???? ????? ?? ???, ?????? ??? ???? ??????? |ForeColor:. ?? ????????? ?? ?????? Box ?? foreground color (??????? ?? ???) ??? ???? ?? ??? ???? ???? ?? |Location: ?? ????????? ????? ?? TextBox ?? starting position ??? ???? ?? ??? ???? ???? ?? |Locked: ?? ????????? ????????? ???? ?? ?? TextBox ?? ??? ?? ?????? ???? ?? ???? ?? |Multiline: ?? ????????? ?? ?????? ??????? ?? ?? ?? ???? ???? ??? ???????? ???? ?? ??? ???? ???? ?? |PasswordChar: ?? ????????? ?? ?????? ??????? ??????? ?? ??? ???? ? ??? ???? ???? ?? |ReadOnly: ?? ????????? ????????? ???? ?? ?? TextBox control ?? ??????? ?? ????????? ???? ?? ???? ?? ?? ???? |ScrollBars: ?? ????????? ????????? ???? ?? ?? Textbox ??????? ??? Scroll Bar show ???? ?? ??? | ?? ????????? ?? ????? ?????? ???? ???: None, Horizontal, Vertical, Both.Size: ?? ????????? ?? ?????? TextBox ?? ???? ?? ??? ???? ?? ??? ???? ???? ?? |TabIndex: ?? ????????? TAB order ?? ??????? ????????? ???? ?? Text: ?? ????????? ?? ?????? TextBox ?? ??????? ?? ??? ???? ?? ??? ???? ???? ?? |TextAlign: ?? ????????? ?? ?????? TextBox ?? ??????? ?? ????????? ?? ??? ???? ?? ??? ???? ???? ?? |Visible: ?? ????????? ????????? ???? ?? ?? TextBox visible ?? ?? hidden ?? |MessageBoxMessageBox .Net ??? ?? ????? ???? ?? ????? MsgBox ?? ???? ????????? ???? ??? | MessageBox ?? ?????? ?? ????? ?? ?????? ????? ??? ???????? ???? ?? ??? ???? ???? ?? | MsgBox ??? MessageBox ??? ???? ?? ??? ?? ?? MsgBox ?? ?????? ?? ?? MessageBox ?? ????? ?? | MessageBox ????? ??? ??????? ?????? show ???? ?????-????? ???????? ?? ??? ?????? ?? | ????? ????? ?? ?? ???? ?? ??? MessageBox ?? ?? ???? ?? Call ???? ???? ?? | MessageBox.Show("Hello World!")MessageBox.Show ???? ?? Syntax ????? ?????? ?? :[DialogResult]= MessageBox.Show([prompt], [caption], [MessageBoxButtons], [MessageBoxIcon], [MessageBoxDefaultButton], [MessageBoxOptions])MessageBox ??? Show Method ?? arguments ?? ????? ?? ?????? ??:prompt – MessageBox ??? ????? ???? ???? ??????? ?? prompt ???? ??? | .caption –?? ??????? ?? ?? MessageBox ?? ????? ??? ?? ????? ???? ?? | MessageBoxButtons - ?? MessageBox ??? ????? ???? ???? ??? ?? ????????? ???? ?? | ??????? ??? ???:MessageBoxButtons.AbortRetryIgnore (displays the Abort, Retry, and Ignore buttons)MessageBoxButtons.OK (displays the OK button)MessageBoxButtons.OKCancel (displays the OK and Cancel buttons)MessageBoxButtons.RetryCancel (displays the Retry and Cancel buttons)MessageBoxButtons.YesNo (displays the Yes and No buttons)MessageBoxButtons.YesNoCancel (displays the Yes, No, and Cancel buttons)MessageBoxOptions – ?? ????? ???????? ?? specify ???? ?? ?????? ???? ?? | ??????? ??? ???:??MessageBoxOptions.DefaultDesktopOnly (displays the message box on the active desktop)??MessageBoxOptions.RightAlign (displays the message box text right-aligned)??MessageBoxOptions.RtlReading (displays the text in right-to-left reading order)??MessageBoxOptions.ServiceNotification (displays the message box on the active desktop, even if there is no user logged on to the computer)??????:Dim intResponse As DialogResultintResponse = MessageBox.Show("Are you sure you want to delete all of the rows in the Customer table?","Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)If intResponse = DialogResult.Yes Then' delete the rowsEnd IfProgramming with (i) Data Types???? ???? ?? ????????? ???? ?? ?? ?? ??????? ?? ???????? ??? ?????? ?? ???? ????? ?? ???? ?? | ?????? ?? ??? ???????? ?? ??? ???????? ??, ?? ???????? ?? ??? ??????? ??|???? ?? ????? ???? ?? ??? ???? ???? ?????? ???? ?? | ????? ???? ???? ?????? ???? ??:S.No.Data TypeDescriptionSizeByteUsed to store binary numbers1 byteBooleanUsed to store logical values , True and False2 bytesCharUse to store a single Unicode character2 bytesShortUsed to store smaller range of numeric data2 bytesIntegerUsed to store numeric data4 bytesObjectUsed to store data of any type4 bytesSingleUsed to store single precision floating-point values4 bytesDoubleUsed to store double precision floating-point values8 bytesDateUsed to store date and time information8 bytesLongUsed to store large numeric data8 bytesDecimalUsed to store very large floating-point values16 bytesStringUsed to store alphanumeric data2 bytes(vi) Operators?? ?????? ?? symbol ?? ?? ?? ???????? ?? ??????? ?????? ?? ??????? ?????? ???? ?? ??? ???? ??? Visual Basic .NET ????? ?????? ?? ?????? ???? ??:??Arithmetic Operators??Comparison Operators??Logical/Bitwise Operators??Assignment OperatorsArithmetic Operators ????????? ??????Arithmetic operators perform mathematical calculations. ????????? ?????? ?????? ?????? ?? ?????? ???? ?? ??? ???? ???? ?? | Visual ??? ????? ????????? ?????? ???? ???:??? ????? ??????? x ?? ?????? 5 ?? y ?? ?????? 2 ??, ??:OperartorDescriptionExample+?? operands ?? ????? ?? |X + Y will give 7-???? operand ??? ?? ????? operand ?? ????? ?? | X - Y will give 3*?? operands ?? ???? ???? ?? |X*Y will give 7/?? operand ?? ????? operand ?? ??????? ???? ???? ?? ?? ???????? ????? ?????? ??????? ???? ?? |X / Y will give 2.5\?? operand ?? ????? operand ?? ??????? ???? ???? ?? ?? ??????? ?????? ??????? ???? ?? |X \ Y will give 2^?? ???? ?? power ??????? ?? ??? ???? ???? ?? |X^Y will give 25MODModulus ?????? ?? operand ?? ???? operand ?? ??????? ???? ?? ??? remainder ???? ???? ?? |X MOD Y will give 1Comparison OperatorsComparison operators are used to compare expressions. Comparison ???????? ?? ????? ??????????? ?? ????? ???? ?? ??? ???? ???? ?? | Visual Basic .NET ??? ????? ?????? ?? ????? ??????????? ?? ????? ???? ?? ??? ???? ???? ??:??Relational Operators??Is Operators??Like OperatorsRelational Operators??????? ?????? ?? ????? ?? ?????????? ????? ?? ????? ???? ?? ??? ???? ???? ?? ??? ?????? ?? ??? ??? ?????? ??? ??????? ???? ?? |???? ??? ??? ???? ??? ??? ?????? comparison ?????? ??? ??? ??? | ??? ?????? ?? ??????? A ?? ??? 10 ??? ??????? B ?? ??? 20 ??, ??:OperatorDescriptionExample=?? ?? operands ?? ????? ?? ??? ???? ?? ?? ?? ????? ??? ?? ???? | ??? ????? ??? ?? ?????? ???? ???? ?? | (A = B) ???? ???? ?? < >?? ?? operands ?? ????? ?? ??? ???? ?? ?? ?? ????? ??? ?? ???? | ??? ????? ???? ??? ?? ?????? ???? ???? ?? |(A <> B) ???? ?? >?? ??? ???? ?? ?? ????? operand ?? ??? ????? operand ?? ??? ?? ???? ?? | ??? ???? ?? ?? ?????? ???? ???? ?? | (A > B) ???? ???? ??<?? ??? ???? ?? ?? ????? operand ?? ??? ????? operand ?? ??? ?? ?? ?? | ??? ?? ?? ?? ?????? ???? ???? ?? | (A < B) ???? ??>=?? ??? ???? ?? ?? ????? operand ?? ??? ????? operand ?? ??? ?? ???? ?? ????? ?? | ??? ???? ?? ????? ?? ?? ?????? ???? ???? ?? | (A >= B) ???? ???? ??<=?? ??? ???? ?? ?? ????? operand ?? ??? ????? operand ?? ??? ?? ?? ?? ????? ?? | ??? ?? ?? ????? ?? ?? ?????? ???? ???? ?? | (A <= B) ???? ????????: Dim Result as BooleanResult=50>60 ‘Returns FalseResult=62=62 ‘Returns TrueResult=14<>24 ‘Returns True??? ??? ??? ????????? ??? ?? ?????????? ????? ?? ????? ???? ?? ??? ?????? ?????? ?????? ?? ??? ??? ???? ?? |Is Operator?? ????? ???????? ???????? ??????? ?? ????? ???? ?? | ??? ????? ???????? ????? ????? ?? ???????? ??? ?? ?? ???? ?????? ?????? ???? ?? | ??? ???? ?? ?? ????? ?????? ?????? ???? ?? |??????: Dim object1 As String = ""Dim object2 As Form = NothingDim result As Booleanresult = object1 Is object2MessageBox.Show(result) ‘Returns FalseLike OperatorThe Like operator is used to compare strings and return a Boolean value as the result. LIKE ?????? ?? ?????? ?? ???????? ?? ????? ???? ?? ??? ???? ???? ?? ??? ?????? ?????? ?????? ?? ??? ??? ???? ?? |??????: Dim Result as BooleanResult=”VB” Like “VB” ‘Returns TrueResult=”VB” Like “vb” ‘Returns FalseLogical and Bitwise OperatorsLogical operators enable you to perform logical operations. ?????? ?????? ?? ?????? ?????? ?????? ?? ?????? ???? ?? ??? ???? ???? ?? | Visual Basic .NET ????? ?????? ?????? ?????? ???? ??:??AND Operator??OR Operator??NOT Operator??XOR Operator??AndAlso Operator??OrElse Operator.AND OperatorAND operator ?? ?????? AND ?????? ?????? ?? ?????? ???? ?? ??? ???? ???? ?? | AND ?????? ???? ??? ?????? ???? ?? ??? ??? ?????????? ?? ??? ???? ?? | ??????:Dim Result As BooleanDim X As Integer=40Dim Y As Integer=30Dim Z As Integer=20Result=X>Y AND Y>Z ‘Returns TrueResult=Y>X AND Y>Z ‘Returns FalseOR OperatorOR operator ?? ?????? OR ?????? ?????? ?? ?????? ???? ?? ??? ???? ???? ?? | OR ?????? ???? ??? ?????? ???? ?? ??? ??? ?? ?????????? ?? ??? ???? ?? | ??????:Dim Result as BooleanDim X As Integer=40Dim Y As Integer=30Dim Z As Integer=20Result= X>Y OR Y>Z ‘Returns TrueNOT OperatorNOT ?????? ?? ?????? operand ?? NOT ?????? ?????? ?? ?????? ???? ?? ??? ???? ???? ?? |. The operands ?????????? ?? ?? ???? ?? ?? ??? ?? ?? ???? ?? | NOT ?????? ?????????? ?? ?????? ?? ?????? ??? ?????? ???? ?? | ??? ?????????? ?? ?????? ???? ?? ?? ?? ????? ??? ?????? ???? ??|??????:Dim Result as BooleanDim X As Integer=40Dim Y As Integer=30Result=NOT(X>Y) ‘Returns FalseXOR OperatorXOR ?????? ?? ?????? ?? ?????????? ?? ?????? exclusion ?????? ?? ?????? ???? ?? ??? ???? ???? ?? | ?? ???? ??? ?????? ???? ?? ??? ??? ?? ?? ?????????? ???? ?? ?????? ????? ?????????? ???? ? ??? |??????:Dim Result as BooleanDim X As Integer=40Dim Y As Integer=30Dim Z As Integer=20Result=X>Y XOR Y>Z‘Returns FalseAndAlso OperatorAndAlso ?????? short circuited AND ?????? ???? ?? | AndAlso ?????? AndAlso logical ?????????? ?????? ?? ?????? ???? ?? ??? ???? ???? ?? | ?? ????? ??? ?????? ???? ?? ??? ????? ?????????? ????? ?? ??? ???? ?????????? ?? ????? ??? ???? ?? |??????: Dim X As integer=40Dim Y As Integer=30Dim Z As Integer=20Dim Result As BooleanResult=Y>X AndAlso Z>X ‘Returns False??? ??? ??? ?????? ??? ??????? ?????????? ?? ????? ??? ???? ?????? ?????? ????? ?????????? ????? ?? | ???? ?????? ????? ???? |OrElse OperatorOrElse ?????? short circuited OR ?????? ???? ?? | OrElse ?????? OrElse logical ?????????? ?????? ?? ?????? ???? ?? ??? ???? ???? ?? | ?? ???? ??? ?????? ???? ?? ??? ????? ?????????? ???? ?? ??? ???? ?????????? ?? ????? ??? ???? ?? |??????: Dim X As integer=15Dim Y As Integer=10Dim Z As Integer=5Dim Result As BooleanResult=X>Y OrElse Y>Z ‘Returns TrueAssignment OperatorAssignment ?????? ?? ?????? ?????? ?????? ????? ???? ?? ??? ???? ???? ?? ?? ?? ??????? ??? ?????? ????? ?? ???? ?? | "=" ?????? ?? ?????? ????? ???? ?? ??? ???? ???? ?? | | "=" ?????? ?? ?????? ????? ???? ?? ??? ?? ???? ???? ?? | ?????? ?? ??? ?? ??????? ?? ‘+’ Addition ?????? ?? ????? ?? ?????? ?? “=” assignment ?????? ?? ????? ??????? ??? ????? ????| OperatorDescriptionExample=????????? ?????? ????? operand ?? ?????? ?? ???? operand ??? ????? ???? ?? |C = A + B ?? A + B ?? ??? ?? C ??? ????? ????? +=?? ????? operand ?? ???? operand ??? ????? ?? ??? ?????? ?? ???? operand ??? ????? ???? ?? |C += A ?? C = C+A ?? ????? ?? =?? ????? operand ?? ???? operand ?? ????? ?? ??? ?????? ?? ???? operand ??? ????? ???? ?? |C - = A ?? C = C – A ?? ????? ?? *=?? ????? operand ?? ???? operand ??? ???? ???? ?? ??? ?????? ?? ???? operand ??? ????? ???? ?? |C *= A ?? C = C* A ?? ????? ?? /=?? ???? operand ?? ????? operand ?? ??????? ???? ?? ??? ?????? ?? ???? operand ??? ????? ???? ?? | ?????? ???????? ????? ??? ?????? ???? ?? |C /= A ?? C = C / A ?? ????? ?? \=?? ???? operand ?? ????? operand ?? ??????? ???? ?? ??? ?????? ?? ???? operand ??? ????? ???? ?? | ?????? ??????? ??? ?????? ???? ?? |C \= A ?? C = C\A ?? ????? ?? ^=?? ???? operand ?? ???? ????? operand ?? ?????? ?? ??????? ?? ??? ?????? ?? ???? operand ??? ????? ???? ?? | C^=A ?? C = C ^ A ?? ????? ?? (vii) Branching Statement/Decision Making Statement/Conditional ??? Decision making????????? ?? ?????? ????????? ?? ???? ?? ?? ???? ?????? ?? ??? ???? ??????? ???? ???? ?? | ?? program ds LVsVesaV dks selective cukrs gSa ftlls izksxzke ds dqN LVsVesaVExecute gksrs gSa ,oa dqN ughaA ;s lkekU;r% fuEu izdkj ds gksrs ?? :1. If Statement??If….Then??If….Then…Else??If….Then….ElseIf Statement??Nested If Statements2. Select Case StatementIf Statement?? ?????? ?? ????? ???? ??, ?? ?????? ?? ???? ???? ?? ????????? ????? ?? execute ???? ?? | If……..then ?? ??????? ????????? ?? ???? ????? ??? ??? ?? decision making ????????? ??? ???? ?????? ?????? ???? ???? ?? ??? ????????? execution ?? ???? ????????? ???? ?? | ?? ????????? ?? ?????? ?????? ?? ????? ???? ?? ??? ???? ???? ?? ??? ?????? ?? ???? ???? ?? ????????? ????? ?? execute ???? ?? | ??? ?????? ????? ?? ?? if ????????? ?? ??? ?? ????????? execute ???? ?? | Syntax:If <condition> ThenStatement BlockEnd IfExample:Dim mark as integerIf mark>40 thenMsgbox (“Pass”)End if If … Then … Elsebl izdkj ds LVsVesaV esa if ds lkFk ,d daMh’ku fMQkbu dh tkrh gSA ;fn condition true gksrh gS If block ds statements execute gksrs gSa vU;Fkk else block ds statement execute gksrs gSaA bls ;wt djus ds fy, fuEu syntax dk ;wt djrs gSa& Syntax:If <condition> ThenStatement blockElseStatement block2End IfExample:Dim no as integerno=Textbox1.TextIf no MOD 2=0 ThenMsgbox(“EVEN NUMBER”)ElseMsgbox(“ODD NUMBER”)End IfIf…ElseIf…Then Statement???? ?????? izksxzke esa multiple conditions ?????? ???? ?? ??? ???? ???? ?? | ????? if ?? ??? elseif ?? ?????? ???? ???? ?? | ??? if ????????? ??? ?? ??? ?????? ???? ?? ?? if ?? ????????? ????? execute ????| ??? if else ?? ?????? ???? ?? ?? ???????? elseif ?? ????????? ????? execute ???? |if ??? elseif ?? ?????? ?? ????? ???? ?? ?????? ??? ??? ??? else ?? ????????? ????? execute ???? | Syntax:If <condition> thenStatement block 1ElseIf <condition> thenStatement block 2ElseIf <condition> thenStatement block 3………………..………………..ElseStatement block elseEnd If??????:Dim x As Integer=5Dim y As Integer=10If x = y ThenMsgbox(“x is equal to y”)ElseIf x > y ThenMsgbox(“x is greater than y”)ElseMsgbox(“y is greater than y”)End IfNested If Statement?? ????????? ?? ?????? ???????? ?????? ?? ??? ???? ?? ??? ???? ???? ?? | ?? ????????? ??? if ?? if else ????????? ?? ????? ???? if ????????? ?? if else ????????? ?? ???? ??? | Syntax:If <Condition> ThenIf <Condition> Then<Statement block>Else<Statement block>End IfElse<Statement block>End if??????:Dim a,b,c as Integera=10b=20c=30If a>b ThenIf a>c ThenMsgBox(“a is greatest”)ElseMsgbox(“c is greatest”)End IfElseIf b>c ThenMsgBox(“b is greatest”)ElseMsgbox(“c is greatest”)End IfEnd If2. Select Case Statementbl LVsVesaV dk ?????? nested if dh rjg izksxzke esa multiple condition define djus ds fy, fd;k tkrk gSA Select Case statement????use??????expression????value??? ??? ????cases ???check? ???? ?? ??? ???? ???? ??? ?????select case??? ???? ???expression????value cases??? ????match??? ???? ??? ?? ????match found????? ?? ???block????statement execute??? ???? ??? ?????case????match ? ???? ???Case Else????statement execute????? ???Syntax:Select Case expressionCase value1Block of one or more VB statementsCase value2Block of one or more VB StatementsCase value3Block of one or more VB statementsCase value4..Case ElseBlock of one or more VB StatementsEnd Select?????? 1:Dim grade As Stringgrade=txtgrade.TextSelect Case gradeCase "A+"result.Text="Excellence"Case "A"result.Text="Good"Case "B"result.Text="Average "Case "C"result.Text="Pass"Case Elseresult.Text="Fail"End Select?????? 2:Dim mark As Singlemark =TextBox1.TextSelect Case markCase Is >= 85comment.Text = "Excellence"Case Is >= 70comment.Text = "Good"Case Is >= 60comment.Text = "Above Average"Case Is >= 50comment.Text = "Average"Case Elsecomment.Text = "Need to work harder"End SelectEnd Sub(viii) Looping Statement?? ????????? ??? ???? ????????? ?? ???-??? ??????? ???? ?? ?? ?????? ????????? ?? ?????? ???? ??? | ??? ??? ???? ????? ?? ?? ?? execute ???? ?? ?? ?? ?????? ???? ???? ?? | Visual Basic .NET ????? ?????? ?? ??? ?????? ???? ?? | Do Loop2. While Loop3. For Next Loop4. For Each Next Loop5. Do Until LoopDo LoopDo Loop ????????? While ??? ?? ??? ?????? ?? ???? ???? ?? ????????? ????? ?? execute ???? ?? | ??? ?? ??????? ??? ???? ???? ?? | Loop ?? ???? ??? ?? ??? Exit Do Statement ?? ?????? ?? ???? ??? |DO Loop ????? ?? ???? ???????:Do While <condition>Statement BlockLoopDO Loop ????? ?? ??????? ???????:DoStatement BlockLoop While <condition>??????? ??????? ??? ????????? ????? ?? ?? ?? ?? ??? ????? execute ???? ???? ?????? ???? ?? ????? ?? |??????: Print 1 to 100Dim i as Integer=1Do while i<=100Listbox1.Items.Add(i)i=i+1Loop??????? ??????? ??? ??? ?? ?????? ???? ?? ???? ?? :Dim i as Integer=1DoListbox1.Items.Add(i)i=i+1Loop while i<=100While StatementWhile Statement ????????? ????? ?? ?? ?? execute ???? ?? ?? ?? ?? ?????? ????? ??? ?? ???? | While ??? ?? ???? ?? ??? ???? ??? ?? ??? Exit While ????????? ?? ?????? ?? ???? ??? | Syntax:While <condition>Statement BlockEnd While??????: Display Odd Number from 1 10 100Dim I as Integeri=1While i<=100Listbox1.Items.Add(i)I=i+2End WhileFor Statement/For Next StatementFor Next ????????? looping statement???? ???popular looping statement???? ?????use??? series????statements??? ???loop index??? ?????? ??? ????execute????? ?? ??? ???? ???? ??? ?? ????????? ????? ?? ??????? ?????? ??? execute ???? ?? ??? ???? ???? ?? | Syntax:For <Counter>=<Start> To <End> Step <value>Statement BlockNext <Counter >?????counter????variable???, start????end loop????starting and ending point??? ????? ?????value????use 1??? ???????increment/Decrements??? ??? ???? ???? ????for loop??? ??? ?? ????? ?? ????Exit For statement????use ???? ???? ?????????:Program to display even numbers between 1 and 100Dim i as integerFor i=1 to 100 Step 1If i MOD 2=0 thenListbox1.Items.Add(i)Next iFor Each Statement/For Each Next StatementFor Each ????????? For Next ????????? ?? ????? ???? ?? | ?? ????????? ????? ?? ??????? ?????? ??? execute ???? ?? ??? ???? ???? ?? ??? ???? ?????? ???? collection ?? ???????? ??????? ?? ?????? ???? ?? ???? ?? |Syntax: For Each <variable_name> In <name of the collection>Statement BlockNext??? ??? ??? ???????? ??? <variable_name> ??????? ?? ??? ?? ?? <name of the collection> ?? ??????? ?? ??? ?? ????? ???????? ??????? ?? ?????? ???? ?? |?????? 1:Dim arr() as Integer={1,2,3,4,5}Dim i as IntegerFor Each i in arrMsgBox(i)Next?????? 2:ListBox1.Items.Add(“Keyboard”)ListBox1.Items.Add(“Mouse”)ListBox1.Items.Add(“Printer”)For Each Item in ListBox1.ItemsMsgBox(Item)NextDo Until Loop????loop Do while loop??? ??? ?? ???? ??? ?? ???? ???? ???? ?? ?? ?????????????? ????? condition????false????? ???execute????? ???? ???????? ?????? ?????statement????indefinite time????repeat????? ?? ??? ???? ???? ??? Exit Do ????????? ?? ?????? ???? ?? ??? ??? ?? ???? ??? ?? ??? ?? ???? ??? |Syntax:Do Until <condition>Statement BlockLoop??????:Calculate Factorial of any numberDim no, i, fact As Integeri = 1fact = 1no = TextBox1.TextDo Until i > nofact = fact * ii = i + 1LoopMsgBox(fact) ?? ????????? ?? ?? ???? ??????? ??? ?? ???? ?? ???? ?? :Syntax:Do Statement BlockLoop Until <condition>?? ??????? ??? ????????? ????? ?? ?? ?? ?? ??? ????? execute ???? |??????:Display first 100 Natural NumbersDim i as integeri=1DoListBox1.Items.Add(i)i=i+1Loop Until i>100Procedure Procedure ????????? ??? ?? ?? ????? ???? ?? ?? ?? ??????? ????? ???? ??? Procedure ????????? ?? ???? ??????? ??????? ??? break ???? ?? ?????? ???? ?? ????? ???? procedure ?? ????? ????????? ?? ????? ??? debug ???? ???? ?? ???? ?? | ?? ????????? ??? ?????? ???? ??? procedure ???? ?? ???????? ?? ???? ???? ???????? ?? ???? ????????? ?? ??? Bulding Block ?? ??? ????? ???? ?? |Visual Basic .Net ??? ??? ?????? ?? procedure ???? ???:Sub procedures/SubroutineFunction proceduresProperty proceduresSub Procedure ?? Subroutine: Subroutine ?? ??????? ????? ?? ??? ?????? ???? ???? ?? | ?? ??? ????????? ?? ??? ???? ?? ??????? ?? ??? ???? ?????? ???? ???? ?? ??? ???????? ?????? ????? ??? ?? ?????? ??? ???? ?? ???? ?? | Sub Procedure ?? ???? ???????? ?? ??? ?? ???? ?? ?????? Sub Procedure ??? ?????? ???? ???? ???? ?? | Sub Procedure ?? ??? ???? ?? ??? Call ?????? ?? ??? Sub Procedure ?? ??? ?? ???? Sub Procedure ?? ??? ?????? ???? ???? ?? | Sub Procedure ????? Sub ????????? ?? ????? ???? ??? ??? End Sub ?? ??? ?????? ???? ??? | ?? Subroutine event ?? Non event Procedure ?? ???? ??| Sub Procedure ?? ?????? ??General or Non-event procedure??Event procedure or Event handling procedureGeneral Procedure: ?? General Procedure ?? ??????? ????? ?? ???? ???? ?? ??? ?????? ???? ???? ??? ???? deliberately call ???? ???? ????? |Syntax :<Modifires> Sub <Procedure Name> (Parameters)Statemnent Block End SubEx.Private sub sum(Byval a as integer, Byval b as integer)Dim c as integerc = a+bmsgbox (c)End SubCall procedure :Private sub button1_Click()sum (10, 5)End SubEvent procedure or Event handling procedure????? ???????? ???????? ?? sub procedure ???? ??? ?? ?? ???? ????? ???? ?? execute ???? ??? |Syntax:Private Sub Object_Event(args) Handles Object.EventStatement blockEnd SubExample:Private Sub btnSA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSA.Click Dim r As Integer r = txtRadius.Text txtResult.Text = 4 * (22 / 7) * r * rEnd SubFunction Procedure?? function procedure ????? Function keyword ?? ????? ??? End Function ?? ??? ???? ?? | Function procedure, Subroutine ?? ????? ?? ???? ??, ????? ??? ???? ???? ???? ?? ?? Function ?????? ??? ?? ?????? ???? ???? ?? | Calling Function ?? procedure ?? ?????? ???? ???? ?? ??? return keyword ?? ?????? ???? ???? ?? |Syntax:[Modifiers] Function FunctionName [(ParameterList)] As ReturnType[Statements]End FunctionExample:Function Addem(ByVal int1 As Integer, ByVal int2 As Integer) As IntegerReturn int1 + int2End FunctionProperty ProceduresProperty Procedure ???????? ?? ?????? ?? ????????? ?? ?????? ????? ??? ???? ???? ?? | ?? procedure property keyword ?? ???????? ???? ???? ??? |?????? ????? ?????????? Property Procedure ?????? ???? ??:??? Get Procedure property ?? ??? ???? ??? ?? Set Procedure property ?? ?????? ????? ???? ?? |Property procedures ??? Get ??? Set statements ?? ????? ???? ???? ?? |Property procedure ?? Class, Structure ??? Module ??? ?????? ???? ?? ???? ?? | By default property procedure ?????? ???? ??? |Syntax:<modifier>Property <PropertyName>() As DataTypeGetReturn <Value>End GetSet(ByVal Value As DataType)Variable= ValueEnd SetEnd PopertyExample:Public Class Form1Dim age As IntegerPrivate Property Y() As IntegerGetReturn ageEnd GetSet(ByVal Value As Integer)age = ValueMsgBox("Age set")End SetEnd PropertyPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.E_ventArgs) Handles Button1.ClickIf TextBox1.Text = "" ThenMsgBox("Please enter your age")ElseY = TextBox1.TextTextBox1.Clear()End IfEnd SubPrivate Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickMsgBox("Your age is: " & Y)End SubEnd ClassArray??? ?? ????? ?? ???? ?????? ?????? ?? ???? 100 ??????? ?? ??????? ????? ???? ?? | ??? ??????? ?? ??????? ????-???? ????? ???? ?? ??? ???? 100 ??????? ?? ???????? ???? ?? 100 ??????? ???????? ???? ????| ???? ???? ??????? ?? ???????? ??? ????? ???? ???? ????, ????? ????????? ?? ???? ??? ?? ?????? |?? array ?? ????? ???? ???? ?? ?????? ?? ?????? ???? ?? | ??? ?????? ??? ?? array ?? ?? ???? ?????? ?? ??? ?? ??????? ?? ?? ????? ???? ??? Array ?? ?? ???? value store ?? ???? ?? |?????? ?? ???, ??? ???? 100 ??? enter ???? ?? ?? 100 ??????? ??????? ???????? ???? ???? ?? | ?? ??? ?? ?????? ?? ??????? ??? ????? 100 ??????? ???????? ???? ?? ????? ?? ?? ?? array ???????? ???? ?? ???????? ?? |?? array ??? elements ?? ???????? ???? ?? ???? ?? ??? index ?? ????? ???? access ???? ?? ???? ???Example 1:Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles Button1.ClickDim a(2) As Integera(0) = 5a(1) = 10a(2) = 15For Each element As Integer In arrayListbox1.Items.Add(element)NextEnd SubEnd ??? array ?? ???????? ???? ??? ?? array ?? ???????? ???? ?? ???, ?? Dim statement ?? ????? ?????? ? ?????? ?? ???:Dim intData(30) as Integer ' an array of 31 integer valuesDim strData(20) As String ' an array of 21 stringsDim twoDarray(10, 20) As Integer ' a two dimensional array of integersDim ranges(10, 100) 'a two dimensional arrayarray ?? ???????? ???? ??? array ?? ???????? ?? ???? ?? ???? ?? | ?????? ?? ???:Dim intData() As Integer = {12, 16, 20, 24, 28, 32}Dim inames() As String = {"Keyboard", "Mouse", "Scanner", "Joystick", "Light Pen”}Dim miscData() As Object = {"Hello World", 12d, 16ui, "A"c}Array ?? ?????? ?? ????? Array / ??? ????? Array(One Dimensional Array/Single Dimensional Array)?? Array ?? ????? ?? ???????? ?? ???? ??? ?? ????? array ?? ???? ?? ????? ?? ?? ???? ?? ??? ?? ????? ???? ?? ??????(row) ??? ?? ?? ?????(column) ??? ???? ??? | ?? ????? Array ??? ????????? ?? ?? ?????? ??? ????? ???? ?? | ????? ????? ??????? 0 ?? ??????? ???? ?? | ?????? ?? ??? a(5) ?? ????? array ?? ?? ????? Array ?? declarationDim MyArray(10) As IntegerDim MyArray() As Integer={1,2,3,4,5}Dim myArray As Integer() = New Integer(10) {}Dim MyArray() As Integer = New Integer(4) { 1, 2, 3, 4, 5 }Example:Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles Button1.ClickDim i As IntegerDim week(6) As Stringweek(0) = "Sunday"week(1) = "Monday"week(2) = "Tuesday"week(3) = "Wednesday"week(4) = "Thursday"week(5) = "Friday"week(6) = "Saturday"For i = 0 To week.Length - 1MsgBox(week(i))NextEnd SubEnd Class??? ????? ??? ??? ????? ??? ?? ??? ?? ????? ??? ?? ???????? ??????? ?????? ?? ?????? ??? ????? ???? ???? ?? | ??? ????? ??? ?? ??????? ??? ?? ??? ???? ?? | ?? ?? ???????? ?? 2-????? ??? ?? ?????? ???????? ?? ???? ???:Dim a(10, 20) As Stringor, a 3-dimensional array of Integer variables:Dim b(10, 10, 10) As Integer??????:Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles Button1.Click' an array with 5 rows and 2 columnsDim a(,) As Integer = {{0, 0}, {1, 2}, {2, 4}, {3, 6}, {4, 8}}Dim i, j As Integer' output each array element's value 'For i = 0 To 4For j = 0 To 1ListBox1.Items.Add (a(i, j))Next jNext iEnd SubEnd Class ???????? ??? Visual basic ?? Dynamic Array provide ???? ??? ??? ?? ?? special type ?? array ??? Dynamic array ??? array ??? ????? size ?? run time ?? ???? ?? ???? ??? Dynamic array ?? create ???? ?? ??? declaration statement ?? parentheses ( ) blank ?? ???? ???? ???? ???? dimension (subscript ?? size) ???? ???? ???? ?? ReDim statement ?? ????? ?? ?? dynamic array ?? declare ?? ???? ???? Dynamic array create ???? ?? ??? ???? size ?? define ???? ?? ??? Redim statement ?? use ???? ???? ??? Redim statement dynamic array ?? resize ?? defined size ?? ??? ???? ??? ???? ?????? ?? multiple dimension ?? array ?? ???? ?? ???? ???? ???? - Dim a ( ) As Integer Redim a (3, 5)Redim statement ?? syntax ?????????? ??- ReDim [Preserve] arrayname(subscripts)????,Preserve: ?? ??? ?? ???? ????????? ???? ???? ?? ?? Preserve ?????? ????? array ??? ???? ?? ???????? ???? ??? ??? ???? ?? |arrayname: ??? ?? ??? ?? ????? ???? ????????? ???? ?? | subscripts: . Subscripts ??? ???? ?????????(specify) ???? ???Example:Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.ClickDim marks() As IntegerReDim marks(2)marks(0) = 85marks(1) = 75marks(2) = 90ReDim Preserve marks(10)marks(3) = 80marks(4) = 76marks(5) = 92marks(6) = 99marks(7) = 79marks(8) = 75For i = 0 To 10ListBox1.Items.Add(i & vbTab & marks(i))Next iEnd SubEnd Class Jagged ArrayJagged Array ?? Multi dimension Array ???? ?? | ????? ???? ?? dimesion ?? ?? independent sub-array ?????? represent ???? ???? ?? ?? ???? ??? sub-array ?? length different ???? ?? | ???? ?????? ??? ?? ??? ?? ??? jagged array ?????? ?? |?????? ?? ??? ?? scores ??? ?? jagged array ???????? ???? ??? ?? Dim scores As Integer()() = New Integer(5)(){}?????? 1:Public class Form1Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.ClickDim one() As Integer = {1, 2, 3}Dim two() As Integer = {3, 4, 5, 6, 7}Dim jag()() As Integer = {one, two}Dim i, j As IntegerFor i = 0 To jag.Length - 1For j = 0 To jag(i).Length - 1ListBox1.Items.Add((jag(i)(j)))Next jNext iEnd SubEnd Class?????? 2:Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.Click'a jagged array of 5 array of integersDim a As Integer()() = New Integer(4)() {}a(0) = New Integer() {0, 0}a(1) = New Integer() {1, 2}a(2) = New Integer() {2, 4}a(3) = New Integer() {3, 6}a(4) = New Integer() {4, 8}Dim i, j As Integer' output each array element's valueFor i = 0 To 4For j = 0 To 1ListBox1.Items.Add(i & j & vbTab & a(i)(j))Next jNext iEnd SubEnd ClassBuilt-In FunctionBuilt-In Function ??? ?????? ?????????????? ?????? ???? ??? | ??? Built-In Function ?? ???? ???????? ?? ?????? ?????????? ????????? ??? ???????? ???? ???? ??:Input and outputfile handlingdata type inspectiondata type conversionstring handlingformatting,mathematicaldate and timefinancialdrawing????? ?? ??? InputBox() ??? MsgBox() Built-In Function ??? | ?????? ????? ??????? Built-In ?????? ?????? ???? ?? |Input and Output Function: InputBox() ?? ????? ?????? ?? | ?? ???? ?? ??????? ???????? ??????? ???? ?? ??? ?????? ???? ???? ??? MsgBox() ?? ?????? ?????? ?? | ?? ?????? ????? ??? ?? ????? ????????? ???? ?? | InputBox() ?????? ???? ?????? user ?? input ???? ?? ??? ???? ???? ??? ???? ?? dialog box ????????? ???? ?? ????? ?? textbox ???? ?? ????? ???? ????? ?? OK button ?? ????? ???? ??? ?? input ?? ?? value ?? calling program ?? return ?? ???? ??? ???? ?? textbox ?? ?? button ??? ?? message ???? ???Syntax:Public?Function?InputBox(ByVal?Prompt?As?String?[,ByVal?Title?As?String?=?""][ByVal?DefaultResponse?As?String?=?""]?[,ByVal?XPos?As?Integer?=?-1][,?ByVal?YPos?As?Integer?=-1])?As?StringArguments:Prompt: Required, string expression, ???? use input box ?? display ???? ???? message ?? define ???? ?? ??? ???? ???? ??? ???? maximum length 1024 character ???? ???Title: Optional, string expression, ??? input box ?? title bar ?? title ?? define ???? ?? ??? ???? ???Default Response: optional, string expression: ?? ???? ?? ?????? ?? value ? ???? ?? default ?????? ?? ???? ??? XPos: Optional, numerical expression: ???? ?????? input box ?? position define ???? ?? ??? ???? ??? ?? input box ?? left edge ?? ???? screen ?? define ???? ???YPos: Optional, numerical expression: ???? ?????? input box ?? position define ???? ?? ??? ???? ??? ?? input box ?? Top edge ?? ???? screen ?? define ???? ??? MsgBox() ?????? ?? function ?? use dialog box ??? ????? display ???? ?? ??? ???? ???? ??? ?? mesaage dialog box ???? ?? click ?? wait ???? ?? ?? click ???? ?? ?? value return ???? ?? ?? ?? click ?? ?? button ?? indicate ???? ????? function ??? ??? ?? ?? ?????? ?? message dialog box display ???? ?? ??? use ???? ???Syntax:MsgBox(prompt[, buttons] [, title])OrIntegerVariable = MsgBox(prompt[, buttons] [, title])Arguments: 1. Prompt: Required, String Expression, ???? use dialog box ?? display ???? ???? Text message ?? define ???? ?? ??? ???? ???? ??? prompt ?? maximum size 1024 characters ???? ??? prompt ?? multiple lines ?? ???? ??? ???? ??? chr(13) ?? chr(10) ?? use ???? ???? ???2. Buttons: Optional, numeric expression: ???? ?????? msgbox ?? display ???? ???? buttons, icons, default button etc. ?? ??? ???? ???? ??? ?? buttons, icon style, default button, text position etc. ?? ??? ?????? ???? ???? ???3. Title: optional, String expression: ???? ?????? message box ?? title bar ?? display ???? ???? title ?? define ???? ?? ??? ???? ???? ???Settings: ?? settings ?? ?????? msgbox ?? buttons ?? place ?? ???? ???? ??? ?? msgbox ?? appearance ?? behavior ?? define ???? ???MemberValue?????????DescriptionOKOnly0OK button display????? ?? ????OKCancel1?????Cancel????OK button????display????? ?? ???AbortRetryIgnore2?????Abort, retry????Ignore button??? ??? ?????YesNoCancel?????3Yes, no????Cancel??? ???YesNo4Yes????no??? ????RetryCancel5Retry????Cancel??? ???Critical16Critical icon??? ???Question32Question icon??? ???Exclamation48Exclamation icon??? ???Information64Information icon??? ???DefaultButton10First button????default????? ?? ???DefaultButton2256Second button????default????? ?? ???DefaultButton3512Third button????default????? ?? ???ApplicationModal0???mode????user????application????work????? ?? ???msgbox????click????? ?????? ???? ???SystemModal4096?????user????click????? ?? ????application suspend?? ???? ????MsgBoxSetForeground65536Msgbox????foreground window?????? ?? ???MsgBoxRight524288Text????right align????? ?? ???MsgBoxRtlReading1048576?????text Arabic system??? ???????right to left??? ???? ???????? 0-5 ???value buttons,?16,32,48,64 icons,?0,256,512 default button??? ??? ???? ???Return ValueConstants?????Value?OK1Cancel2Abort3Retry4Ignore5Yes6No7Example:Private Sub Button1_Click( ByVal Sender As System.Object, ByVal e as System.EventArgs)Handles Button1.ClickDim Result As IntegerResult=MsgBox(“This is a message box”,MsgBoxStyle.OkCancel+rmation+MsgBoxStyle.SystemModel, ”Example of MsgBox”)If(Result=MsgBoxResult.OK) ThenTextBox1.Text=”You Clicked Ok”End ifEnd SubMathematical ??? Numerical ??????: ?? ?????? ?? ?????? ?????? ?? ?????????? ????? ??? ???? ???? ?? ??? ???? ???? ?? | ??? ??? ?????? ?? ?????????? ?????? Math Class ?? method ?? ??? ??? ?????? ???? ??? ??? | ?????? ?? ???, ???? sqrt () ?? argument ?? ??????? ?? ???? ???? ?? ??? ???????? ???? ?? ???? ??? Math class ?? ???? ?? ???? ?? ????? ???? ?? ???, ??? ????? ?? ????? ?? Imports System.Math statement ???? ???? ???? ?? | ??? ?? statement ??? ???? ???? ?? ?? method ?? ?????? ?? ???? class ?? ??? ????? ????? | Example:Dim a as double=System.Math.Sqrt(25) Math Class ??? ??????? Method ???? ??? | ???????? method ?? literal ?? ?????????? ????? ?? ??? ??? ??????? ???? ?? ??? ?? ?????????? ??? ???? ???Abs(): ????????? ?????? ?? ???????? ??? ???? ?? |Example:Dim no as Doubleno=System.Math.Abs(25.15) ‘returns 25.15no=System.Math.Abs(-25.15) ‘returns 25.15Cos( ): ?? argument ?? cosine ??? ?????? ???? ?? | argument ?? ??? radian ??? ???? ???? ?? |Sin( ): ?? argument ?? sine ??? ?????? ???? ?? | Tan( ): ?? argument ?? tangent ??? ?????? ???? ?? | Sqrt( ): ?? argument ?? ??????? ?????? ???? ???Example:Dim no as Doubleno=System.Math.Sqrt(25) ‘returns 5Round( ): ?? argument ?? rounded ??? ?????? ???? ???Pow( ): ?? argument ??????? ???? ?? ??? ???? argument ??? ??? ??? ???? ?? power ????? argument ?? ??? ?? ??????? ?? |Example:Dim no as Doubleno=System.Math.Pow(5,3) ‘returns 125Min( ): ?? function ?? ???? ??? ?? ??????? ??? ?????? ???? ?? |Example:Dim no as doubleno=System.Math.Min(25.5,20) ‘returns 20Max( ): ?? function ?? ???? ??? ?? ?????? ??? ?????? ???? ?? |Example:Dim no as doubleno=System.Math.Max(25.5,20) ‘returns 25.5Log( ): ?? argument ?? ?????? ??? ?????? ???? ???Example:Dim no as doubleno=Log(2) ‘returns 0.6931471803. String handling functions: ??? ??????? ???????? ???????? ?????? ?????? ??? | ?? ?????? ?? ????? ???????? ?? ?????? ???? ?? ??? ???? ???? ?? | ?????? ?? ??? ?????? Len( ) ?? ???????? ?? ????? ????? ???? ?? ??? ???? ???? ???Example:Asc(str): ?????? Asc(str) ???????? ?? ???? ??????? ?? ASCII code ?????? ???? ?? |Dim no as integerno=Asc(“Dhiraj”)‘Now the value of no is 68, the ASCII code of DChr(no): ?????? Chr(no) ???? ASCII code ?? character ??? ?????? ???? ?? |Example:Dim ch as CharCh=Chr(68)‘ returns result DUCase(str): ?????? UCase(str) ???????? ?? ??? lowercase character ?? uppercase character ??? ????????? ???? ?? |Example:Dim Lstr as StringDim str as String=”nutan”Lstr= LCase(str)‘ returns NUTANLCase(str): ?????? LCase(str) ???????? ?? ??? uppercase character ?? lowercase character ??? ????????? ???? ?? |Example:Dim Lstr as StringDim str as String=”Nutan”Lstr= LCase(str)‘ returns “nutan”Left(str, n): ?? ?????? ???? ???????? ?? ????? ??? ?? ???? n character return ???? ?? |Example:Dim str as string=”Sarojini”Dim newstr as stringNewstr=Microsoft.VisualBasic.Left(str,5)‘returns “Saroj” as outputRight(str, n): ?? ?????? ???? ???????? ?? ????? ??? ?? n character return ???? ?? |Example:Dim str as string=”Sarojini”Dim newstr as stringNewstr= Microsoft.VisualBasic.Right(str,5)‘returns “ojini” as outputMid(str, n, m): ?????? Mid(str, n, m) ???????? ?? nth character ?? ??????? ?? m character return ???? ?? | ???? m argument optional ?? |Example:Dim str, strResult as stringstr=”Dhiraj”strResult=Mid(str,4,3)‘returns “raj” as output??? ????? argument m ???? ???? ??? ?? ?? ?????? nth character ?? ???? ????? character ?? return ???? ?? |Example:Dim str, strResult as stringstr=”Dhiraj”strResult=Mid(str,4)‘returns “raj” as outputLen(str):?? ???????? str ?? ?????? ?? ?? ???????? ??? character ?? ?????? ?????? ???? ?? |Example:Dim no as Integerno=Len(“Dhiraj”)‘returns 6 as outputLTrim(str): ?? ?????? ???????? str ?? ??? ?? ????? ????? ?? | ???? ?????? ??? ???????? str ?? ????? ?? ????? ?????? ???? ?? |Example:Dim strResult as stringstrResult =LTrim(“ Nutan”)‘returns “Nutan” as outputRtrim(str): ?? ?????? ???????? str ?? ???? ?? ????? ????? ?? | ???? ?????? ??? ???????? str ?? ???? ?? ????? ?????? ???? ?? |Example:Dim strResult as stringstrResult =RTrim(“Nutan”)‘returns “Nutan” as outputTrim(str): ?? ?????? ???????? str ?? ??? ?? ???? ?? ????? ????? ?? | Example:Dim strResult as stringstrResult =Trim(“ Nutan ”)‘returns “Nutan” as outputVal(str): ?? ???????? str ?? ???? ??? ????????? ???? ?? |Example:Dim no as integerno=Val(“20”)‘returns 20 as outputStr(no): ?? ???? ???? ?? ???????? ??? ????????? ???? ?? |Example:Dim strResult as stringstrResult =Str(20)‘returns “20” as outputStrReverse(str): strReverse(str) ?????? ???? ???????? ?? reverse ?????? ???? ?? |Dim strResult as stringstrResult =StrReverse(“Nutan”)‘returns “natuN” as outputDate and Time handling functions: ??? ???? ??? ???? ???????? ?????? ?????? ???| ?? ?????? ?? ?????? ??? ?? ???? ???? ?? ?????? ?????? ???? ?? ??? ???? ???? ?? | Now( ): ?? ?????? ??????? ?????? ??? ??? ????? ?? ??? ?????? ???? ???? ?? |Dim dt as Datedt=Now( )‘returns “11/20/2013 7:30:55 AM”Today( ): ?? ?????? ??????? ?????? ????? ?? ??? ?????? ???? ???? ?? |Dim dt as Datedt=Today( )‘returns “11/20/2013”TimeOfDay( ): ?? ?????? ??????? ??? ????? ?? ??? ?????? ???? ???? ?? |Dim dt as Datedt= TimeOfday( )‘returns “7:30:55 AM”DateSerial(intY, intM, intD): ?????? DateSerial(intY, intM, intD) ?????? ?????? ???? ?? ????? intY ???? ??, intM ????? ?? ??? intD ??? ??|Example:DimstrResult=DateSerial(2013,11,22)‘Now the value of strResult is “11/22/2013”DateAdd(strInterval, intN, dt): ?? ?? ?????? ?????? ???? ?? ?? ?? ?????? ?? ??? ??? ????????? ??? ?????? ???? ???? ?? |Example:Dim dt as Datedt=DateAdd(“d”, 5, “11/22/2013”)‘returns “11/27/2013”dt=DateAdd(“m”, 5, “11/22/2013”)‘returns “4/22/2014”dt=DateAdd(“yyyy”, 5, “11/22/2013”)‘returns “4/22/2018”DateDiff(strInterval, dt1, dt2): ?????? DateDiff(strInterval, dt1, dt2) ????????? ??? ?????? ?? ???? ?? ?? ???????? ?? ???? ?????? ???? ?? | Example:Dim n as integerDim dt1, dt2 as datedt1= “11/22/2013”dt2=”12/22/2013”n= DateDiff(“d”, dt1,dt2) ‘returns 30 as outputn= DateDiff(“m”, dt1,dt2) ‘returns 1 as outputn= DateDiff(“yyyy”, dt1,dt2) ‘returns 0 as outputDatePart(strInerval, dt): ?????? DatePart(strInerval, dt) ?????? ?? ?? ??? ?? strInterval ?????? ????????? ?????? ?? ?????? ?????? ???? ?? |Example:Dim n as integerN=DatePart(“d”, “11/22/2013”) ‘returns 22 as outputN=DatePart(“m”, “11/22/2013”) ‘returns 11 as outputN=DatePart(“d”, “11/22/2013”) ‘returns 2013 as outputYear(dt): ?????? Year(dt) ?? date dt ?? year ?????? ???? ?? |Example:Dim dt as datedt=“11/22/2013”Dim n as integer=Year(dt)‘returns 2013 as outputMonth(dt): ?????? Monthdt) ?? date dt ?? month ?????? ???? ?? |Example:Dim dt as datedt=“11/22/2013”Dim n as integer=Month(dt)‘returns 11 as outputDay(dt): ?????? Day(dt) ?? date dt ?? day ?????? ???? ?? |Example:Dim dt as datedt=“11/22/2013”Dim n as integer=Microsoft.VisualBasic.Day(dt)‘returns 11 as outputHour( ): ?? ?????? ??? ??? ??? ?? Hour ?????? ???? ?? | ??? ?? ?????? ??? now() argument ?? ??? ??? ??? ???? ???? ?? ?? ?? ??????? Hour ?????? ???? ?? |Dim n as Integern=Hour(Now)‘returns 4 if Now( ) returns “11/22/2013 4:20:15 AM”Minute( ): ?? ?????? ??? ??? ??? ?? Minute ?????? ???? ?? | ??? ?? ?????? ??? now() argument ?? ??? ??? ??? ???? ???? ?? ?? ?? ??????? Minute ?????? ???? ?? |Dim n as Integern=Minute(Now)‘returns 20 if Now( ) returns “11/22/2013 4:20:15 AM”Second( ): ?? ?????? ??? ??? ??? ?? Second ?????? ???? ?? | ??? ?? ?????? ??? now() argument ?? ??? ??? ??? ???? ???? ?? ?? ?? ??????? Second ?????? ???? ?? |Dim n as Integern=Second(Now)‘returns 15 if Now( ) returns “11/22/2013 4:20:15 AM”TimeSerial(intH, intM, intS): ?????? TimeSerial(intH, intM, intS) Time format (h:m:s) ?? ?????? ??? ?????? ???? ?? |Example:Dim str as stringstr=TimeSerial(10,25,30)‘returns value “10:25:30 PM”Data Type Inspection functions: ?? ?????? ?? ????? ?? ??? ??? ?????????? ?? ???? ???? ?? ???????? ?? ??? ????? ???? ???? ??? ?????? ?? ??? IsNumeric() ?????? ???? return ???? ?? ??? argument ???? ??, ?????? ????? return ???? ?? |??? Data Type Inspection ?????? ?? ?????? ?? |IsArray( ): ?????? IsArray( ) true ??? ?????? ???? ?? ??? argument array ?? | ?????? false ??? ?????? ???? ?? |Example:Dim n as IntegerDim x(10) as IntegerDim br as Bolleanbr=IsArray(n) ‘returns value Falsebr=IsArray(x) ‘returns value TrueIsDate( ): ?????? IsDate( ) true ??? ?????? ???? ?? ??? argument Date ?? | ?????? false ??? ?????? ???? ?? |Example:Dim n as IntegerDim dt as DateDim br as Bolleanbr=IsDate(n) ‘returns value Falsebr=IsDate(dt) ‘returns value TrueIsNothing( ): ?????? IsNothing( ) true ??? ?????? ???? ?? ??? argument Nothing ?? | ?????? false ??? ?????? ???? ?? |Example:Dim obj as objectDim br as Resultobj=Nothingbr=IsNothing(obj) ‘returns Trueobj=New Point(5,10)br=IsNothing(obj) ‘returns FalseIsNumeric( ): ?????? IsNumeric( ) true ??? ?????? ???? ?? ??? argument Numeric ?? | ?????? false ??? ?????? ???? ?? |Example:Dim n as integer=10Dim str as string=”Nutan”Dim br as Booleanbr=IsNumeric(n) ‘returns Truebr=IsNumeric(str) ‘returns FalseIsReference( ): ?????? IsReference ( ) true ??? ?????? ???? ?? ??? argument object variable ?? | ?????? false ??? ?????? ???? ?? |Dim str as StringDim n as IntegerDim bResult as BooleanbResult= IsReference(str) ‘returns TruebResult=IsReference(n) ‘returns FalseTypeName( ): TypeName( ) ?????? ?? argument ?? ???? ???? ?? ??? ?????? ???? ?? | Dim n as IntegerDim dt as dateDim str as Stringstr=TypeName(n) ‘returns Integerstr=TypeName(dt) ‘returns DateData Type Conversion Functions: Data Type Conversion ?????? ?? ???? ???? ?? ??? ?? ???? ???? ???? ??? ????????? ???? ?? |CType() ?????? ?? ????? ???????? ?????? ?? valid argument ??????? ???? ?? | CBool( ): ?????? CBool() ??? ??? argument ?? expression ?? Boolean type ??? ????????? ???? ?? | ??? ??? ??? argument ?? expression ?? ??? ????? ??? ?? ?? ???? ??? ?????? ???? ??| ?????? ????? ??? ?????? ???? ?? |Example:Dim n as Integer=10Dim m as Integer=0Dim bResult as BooleanbResult=CBool(n) ‘returns TruebResult=CBool(m) ‘returns FalseCByte( ): ?????? CByte() ??? ??? argument ?? expression ?? Byte type ??? ????????? ???? ?? |Example:Dim b as Byteb=CByte(10.25)‘returns 10CChar( ): ?????? CChar( ) ??? ??? argument ?? expression ?? character data type ??? ????????? ???? ?? |?????????: ??? argumnent ?? ???????? ?? ?? ?? ?????? ???????? ?? ????? character ?? return ???? ?? |Example:Dim ch as Charch=CChar(“Dhiraj”)‘returns DCDate( ): ?????? CDate( ) ?? argument(????????) ?? Date ???? ??? ????????? ???? ??| ?? ???????? argument ??? valid ?????? ?? ??? ???? ????? | Example:Dim dt as Datedt=CDate(“12/22/2013”) ‘returns “12/22/2013” as date typedt=CDate(“08:25:20 AM”) ‘returns “08:25:20 AM” as date typeCDbl( ): ?????? CDbl( ) argument ?? Double ???? ??? ????????? ???? ??| Example:Dim dbl as Doubledbl=CDbl(10) ‘returns 10 as Double typeCDec( ): ?????? CDec( ) argument ?? Decimal ???? ??? ????????? ???? ??| Example:Dim dec as DecimalDec=CDec(25.12345) ‘returns 25.12345 as Decimal typeCInt( ): ?????? CInt( ) argument ?? Integer ???? ??? ????????? ???? ??| ??? argument ?????????? ?????? ??, ?? ?? ?????? integer ?? rounded ?????Example:Dim n as Integern=CInt(“20”) ‘returns 20 as Integer Typen=Cint(20.75) ‘returns 21 as Integer typeCLng( ): ?????? CLng( ) argument ?? Long ???? ??? ????????? ???? ?? | .Example:Dim n as integern=CLng(15.25) ‘returns 15 as Long typen=CLng(15.75) ‘returns 16 as Long typeCObj( ): ?????? CObj( ) argument ?? object ???? ??? ????????? ???? ?? |Example:Dim dbl as DoubleDbl=12.25dbl=CObj(dbl)‘returns 12.25 as Object typeCShort( ): ?????? CShort( ) argument ?? short ???? ??? ????????? ???? ?? |Example:Dim n as IntegerDim m as Shortn=25m=CShort(n)‘returns 25 as Short typeCSng( ): ?????? CSng( ) argument ?? single ???? ??? ????????? ???? ??|Example:Dim dbl as DoubleDim sng as Singledbl=125.12345sng=CSng(dbl)‘returns 125.1235 as Single typeCStr( ): ?????? CStr( ) argument ?? string ???? ??? ????????? ???? ?? |Example:Dim n as Integer=25Dim str as Stringstr=CStr(25)‘returns “25” as String typeCType( ): ?????? CType( ) ????? argument ?? ??????? argument ??? ??? ?? data type ??? ????????? ???? ?? |Example:Dim n as Integer=25Dim str as Stringstr=CType(n, String)‘returns “25” as Integer typeUnit-2SDI and MDI ApplicationSDISDI ?? ????? ??? Single Document Interface ?? | ?? ???????? ??? ?? ??? ?? ???? ?? ?? ??????????(????????) ???? ?? ???? ?? | ?? ?? ??? ?????????? ????? ????? ???, ?? ???? ???? ??? ?? ?? instance ?? ????? ?? ????? ??? Single Document Interface (SDI) ??? ??? windows ?? ????? ?? ???????? ???? ?????????? ?? ???, ?????? SDI ?? ?? ?????? ???MDIMDI ?? ????? ??? Multiple Document Interface ?? | ?? ??????? ??? ?? ??????? ?? ?? ?????????? ?? ??? ???? ????MS Word MDI ?? ?? ?????? ??? ?? ?? ?????????? ?? ???? ?? ?? ???? ??? ?????????? ?? ??? ??? ???? ??? ???? ??? ?SDI ??? MDI ??? ???? SDIMDISDI ?? ????? ??? Single Document Interface ??|MDI ?? ????? ??? Multiple Document Interface ?? |?? ???????? ??? ?? ??? ?? ???? ?? ?? ??????????(????????) ???? ?? ???? ?? |?? ???????? ??? ?? ??????? ?? ?? ?????????? ?? ??? ???? ??? |????? parent window ???? ???? ?? | Single Window ?? parent window ?? ??? ?? child window ???? |??? child window ?? ?? parent window ???? |?? ?? window ?? ????? ?? ???? ??? |?? ?? window ?? ????? ?? ???? ??? |?? ????????? ?? ???? ????????? ?? ????? ???? ???? ???? ????? ????????? ?? ???? ????????? ?? ????? ???? ???? ???? ???SDI ??? inheritance ???? ???? ?? |SDI ??? inheritance ???? ?? |?? ????????? ?? ??? ???? ????? ???? ???? ???Single Menu ?? ????????? ?? ??? ???? ???? ???? ?? ????? ?????????? ?? workload ?? ???? ?? ?? ?????? ?? ????? ?? ????? ???? ?? | ??????: Notepad, Internet Explorer 6??????: MS Word, MS Excel, AdobePhotoshopSDI ????? ?? ??????? ????(Creation of SDI Forms)Windows Form ?? SDI ??????? ?? ??? ?? ???? ?? ???????? ?? ??? ??? ???? ?? ?????? ???? ?? ? ?? ??? ?????????? ?? ????? ?? ????? ?? ??? ?? ??? ????????? ????????? ???? ????? ??? ?????? ????? ?? add ???? ??? ??? ?? ??? SDI Form ??? | ??? ?????? ???? ?? SDI ????????? ??????? ???? ?? ????? ?? ????? ?? ?????? ????? ??? | ???? ?? ?? ????? ??? ?? button ?? | ?? ?? button ?? ????? ???? ?? ?? ?? ??? ????? ????? ????? | ??? ????? ?? ??????? ????? ?? Instance ?? ????? ?? label ?? ??????? “This is the Second Windows Form” ????????? ???? ?? | ?? ?? “Show Second Windows Form” button ?? ????? ???? ?? ?? ??????? ?????? ????? ????? ???? ?? |????? ????? ?? ??????? ?????? ????? ?? ???? ??? ??? ???? ??? ?? ?? ?? ????? ?????? ????? ??? ????? ???? ?? |SDI ????????? ????? ?? ???, ????? ????? ?? ???? ????:1. ???????????? ?????? ???????? 2008 ?? open ?????? ?2. File menu ??? ?? New Project ?? ????? ?????3. ?? ??? Windows Application ?????? Windows form ??? ?? ??? Button1 ????? |4. Button1 ?? Text property ??? “Show Second Windows Form” value set ???? |5. Form1 ?? Text property ??? “First Windows Form” value set ???? |6. Project menu ?? ????? ???? ?? ??? “Add Windows Form” ?? ????? ????? Add New Item Dialog box ????? ???? ?? ???? ????? ??? ?????? ??? ??:7. Template Pane ???, Windows Form ??? ????? ?????? ??? ??? Add ?? ????? ??????| ?? ?? ????? ??? ?????? ????????? ??? ????? ???? ??? Form ?? text property ?? “Second Windows Form” ??? ????????? ?????? |8. “Second windows form” ?? Label1 ???? label ?????? ?? ???? text property ?? “This is the Second Windows Form” ??? ????????? ?????? |9. Windows Form1 ?? Button1 ?? ??? ????? ?????? | ????? code ?? ?????? |Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.ClickDim secondWindow As New Form2secondWindow.Show()End SubCode ??? Form2 ?? ?? ???????? ??????? ???? ??? ?? ??? Windows Form ?? Show method ?????? ?????? ??? ?? |Parent ??? Child MDI form ??????? ?????????? ????? ?? MDI feature ?? ????? ??? ?? ?????????? ?? open ???? ?? ?????? ???? ?? | ?? ???? ??? ?? ????? ?? ????? ???? ???? ????? ??? ?? ???? ??? | Windows Form ????? ?? ?????????? ???? ???, MDI Parent Form ?? ??? ??? ???? ???? ??? MDI Parent Form ??? ????? ???????? ?????????? MDI Child ?? ??? ??? ???? ???? ??? ??? ?????? ?? ?? ????????? ??? child ??? parent ????? ??? | ????? ????? ??? ?? menu bar ?? ????? File ??? Windows menu ??? | File menu ?? ????? ?? Menu Item “New” ??? “Exit” ???? ????? | Windows menu ??? ??? menu item “Tiles Windows Horizontally”, “Tiles Windows Vertically” ??? “Cascade Windows” ???? ????? |?? ?? File New ?? ????? ???? ?? ?? MDI Child ?? ?? new instance ??????? ???? ?? ?? MDI Parent Form ??? ????? ???? ?? | ?? MDI Child ?? ?? instance ??? ???? ???? File Close ?? ????? ?? Active MDI Child Form ?? ??? ???? ???? ?? | ?? ?? Windows Tiles Windows Horizontally ????? ???? ??? ?? ??? child form ??????? ??? ??? arrange ?? ???? ????? | ??? ??? “Tiles Windows Vertically” ??? “Cascade Windows” ?? ??? ???? ???? ??????MDI Windows application ????? ?? ???, ????? ????? ?? ???? ????:1. ???????????? ?????? ???????? 2008 ?? open ?????? ?2. File menu ??? ?? New Project ?? ????? ?????3. ??? Windows application ??????? ??????| Windows Form 1 ?? IsMdiContainer property ?? True ?????? | 4. Form1 ?? Text property ??? “Menu” ????? |5. Form1 ?? ?? menustrip control ??????| Menu ??????? ???? ?? ??? Menu items ???? ?????? |3105150-12700Menu Item ?? ??? shortcutkey property ??? ???? ShortcutKeys ?? ??? ?????? |Menu Items ??????? ???? ?? ??? MDI parent form ?? menu item ?? ?????? click ????? ?? ??? ????? | ‘ Code for New Menu ItemPublic i As IntegerPrivate Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles NewToolStripMenuItem.ClickDim child As New Formchild.MdiParent = Mei = i + 1child.Text = "Child " + CStr(i)child.Show()End Sub??? ??? ??? ??? ??? ????? ?? ?? ??? ???????? child ??? ?? ??????? ???? ??? ?? |Child ?? MDIParent ????????? ?? MdiParent(Me) ??? ???? ??? ?? | Me ?????? ????? MDI Parent ?? refer ???? ?? | child form ?? windows form ?? show() ?? ?????? ???? ?? |‘ Code for the Close Menu ItemPrivate Sub CloseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles CloseToolStripMenuItem.ClickIf me.ActiveMdiChild Is Nothing ThenElseMe.ActiveMdiChild.Close( )End Sub??? ??? ??? ??? ???, CloseToolStripMenuItem _Click ????? ?? ????? ?? ????????? ???? ?? ?? Close menu item ?? ????? ???? ???? ?? | MDIParent Windows form ?? ActiveMdiChild property ?? ????? active MDI child ?? ??????? ???? ?? ??? ???? ???? ?? | ??? ??? active MDI child form ?? ?? function close method ?????? ??? ??? ???? ???? ?? |‘ Code for the Menu Item named “Tile Windows Horizontally”Private Sub TileHorizontallyToolStripMenuItem_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles TileHorizontallyToolStripMenuItem.ClickMe.LayoutMdi(MdiLayout.TileHorizontal)End Sub??? ??? ??? ??? ???, LayoutMdi method MDI Parent form ?? MDI Child form ?? arrange ???? ?? | ?? method ??? value “MdiLayout.TileHorizontal” ??? ???? ??? | ?? ??? MDI Child forms ?? MDI Parent form ?? Horizontally arrange ???? ?? |‘ Code for the Menu Item named “Tile Windows Vertically”Private Sub TileVerticallyToolStripMenuItem_Click(ByVal sender As System.Object, ByVale As System.EventArgs) Handles TileVerticallyToolStripMenuItem.ClickMe.LayoutMdi(MdiLayout.TileVertical)End Sub??? ??? ??? ??? ???, LayoutMdi method MDI Parent form ?? MDI Child form ?? arrange ???? ?? | ?? method ??? value “MdiLayout.TileVertical” ??? ???? ??? | ?? ??? MDI Child forms ?? MDI Parent form ?? Vertically arrange ???? ?? |‘ Code for the Menu Item named “Cascade Windows”Private Sub CasecadeWindowToolStripMenuItem_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles CasecadeWindowToolStripMenuItem.ClickMe.LayoutMdi(MdiLayout.Cascade)End Sub??? ??? ??? ??? ???, LayoutMdi method MDI Parent form ?? MDI Child form ?? arrange ???? ?? | ?? method ??? value “MdiLayout.TileCascade” ??? ???? ??? | ?? ??? MDI Child forms ?? MDI Parent form ?? cascade arrange ???? ?? |Creating Menus at design time?? Menu ???????? ?? ?? ???? ??? ?? ??? ???? ?? ??? ???? ??? ?? ?? menus ?? ?????? ???? ??? ?? ?? ??????? ?? ??? ???? ?? ????? ???? ?? ????? execute ???? ?? | ???? ????, menu item ?? ????? ???? ?? ?? ?? ?????? ?? ??? ???? ?? ???????? ???? ??? ??? ? Click ????? ?? ???????? menu item ?? code ?? ?????? functionality ?? ??? execute ???? ??? ?? | ??? ?? ?????? ?? menu ?????? ???? ??? ???:Menu item ?? ?? Windows form ?? Top ?? menu bar ?? ????? ???? ???? ?? ?????? ??Menu ???? Windows form control ?? ??? ?????? ???Menu item ?? ?? ?? pop up ?? ??? ????? ???? ??? ?? ?? ???????? ?? right click ???? ??? |Menu ??????? ???? ?? ??? ????? ????? ?? ???? ????:MDI Windows application ????? ?? ???, ????? ????? ?? ???? ????:1. ???????????? ?????? ???????? 2008 ?? open ?????? ?2. File menu ??? ?? New Project ?? ????? ?????3. ??? Windows application ??????? ??????| Windows Form 1 ?? IsMdiContainer property ?? True ?????? | 4. Form1 ?? Text property ??? “Menu” ????? |5. Form1 ?? ?? MenuStrip control ??????| Adding Menu items to the Menu BarMenu item ??????? ?????? ?????? ???? ?? ??? ?????? ???? ???? ?????? ?? ?? menu item ?? ????? ?? ???? ??? ?? ??????? ?? ?????? ?? ?????? item ?? ??????? ?? ???? ??? | Menu item ??? character ?? ???? ?? ???? ???? ?? ?????? item ?? ??????? ?? ?????? ??????? ???? ?? ??? ???? ???? ??| ??? Access key ??? ???? ?? | ?? Alt key ?? ??? character ?? ?????? ?? ?? ???? ??? |Menu Item ????? ?? ??? ????? ????? ?? ???? ????:MenuStrip control ??? Menu items ???? ?????? |Menu Item ?? ??? shortcutkey property ??? ???? ShortcutKeys ?? ??? ?????? |Menu Items ??????? ???? ?? ??? MDI parent form ?? menu item ?? ?????? click ????? ?? ??? ????? | Creating Menu at Runtime?? ?? ????? ??? ???????????? ?? ?????? ?? Windows ????? ?? ??? menu ???? ???? ???:“AddMenuAndItems” ??? ?? ??? public procedure ??????? ?????? Public Sub AddMenuAndItems( )‘codeEnd Sub?? procedure ?? ????? ?? MainMenu object ?? ?? instance “mnu” declare ??????| Dim mnu as New MainMenu( )3. Form ?? menu property ??? MainMenu ?? instance ??? ?????? Me. Menu=mnu4. Procedure ?? ????? MainMenu Object collection ??? MenuItem object ?? ??????? ??????:Dim mnuFile as new MenuItem(“&File”)Dim mnuNew as new MenuItem(“&New”)5. ????? ?? mainmenu ??? ????? ??? ??? menu item ???? ???? ??, ???? menu item ?? heading ?? ??? ???? ???? ??, ????? ?? main menu ??? ???? ???? ?? |mnu.MenuItems.Add(mnuFile)6. ??? ??????? menu item ?? mnufile ??? ???? ???? ?? |mnuFile.MenuItems.Add(mnuNew)mnuFile.MenuItems.Add(mnuClose)7. ?? menu item ?? shortcut key ?? ?????? ?? ???? ??? :mnuNew.Shortcut = System.Windows.Forms.Shortcut.CtrlNEnd SubProcedure ?? ????? code ?? ?????? ??:Public Sub AddMenuandItems()Dim mnu As New MainMenu()Me.Menu = mnuDim mnuFile As New MenuItem("&File")Dim mnuNew As New MenuItem("&New")Dim mnuExit As New MenuItem("&Close")mnu.MenuItems.Add(mnuFile)mnuFile.MenuItems.Add(mnuNew)mnuFile.MenuItems.Add(mnuClose)mnuNew.Shortcut = System.Windows.Forms.Shortcut.CtrlNEnd Sub??? ?? menu item design time ?? ????? ??? | class Name drop down list ?? menu item ?? ??? ?? ??? method name drop down list ?? click ?????event procedure ???? ???? ?? | ??? ?? menu item design time ?? ????? ???, ?????? ?????menu item ?? double click ?? automatically code ??? ???? ?? | ?????? ??? ???? menu item ?? programmatically ???? ??, ?? ???? menu item ?? click event ?? ?? event handler ????? ?? ????? ?? | ?? AddMenuAndItems procedure ??? ????? ??? ?? ?????? ?????? ??? ?? ???? ???? AddHandler mnuNew.Click, AddressOf Me.mnuNew_ClickAddHandler mnuClose.Click, AddressOf Me.mnuClose_ClickAddHandler ?? ?????? ???? ?? ?? ?? control(mnuNew) ?? event (click) ?? associated ???? ??, ???? ??? AddressOf ?????? ???? ???? ??| Procedure ?? form ?? load event ?? ??? ???? ???? ?? | ???? ??? ?? code ???? ???? ?? |Private Sub mnuNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Dim child As New Formchild.MdiParent = Mei = i + 1child.Text = "Child " + CStr(i)child.Show()End SubPrivate Sub mnuClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)If me.ActiveMdiChild Is Nothing ThenElseMe.ActiveMdiChild.Close( )End Sub Context Menu/ Pop-up Menus?????? ?????? ????????? ??? shortcut menus ???? ???, ?? ?????????? ?? ????? ????? ?? ?? ????? ?? ???? ??????? ?? ???? ?? ???? ??? ????? ???? ?? ????????? ???? ??? | ?? ?? ???? ????? ???? ??? ?? ??????? menu item ?? ????????? ???? ??????? ?? ?????? ???? ?? | Shortcut Menu ?? popup ?? context menu ??? ???? ??, ??????? ????? menu items ?? ????????? ???? context ?? ?????? ???? ?? ???? ?? ????????? ?????, ?? ????? ?? ??????? ???? ?? ???? ?? ???? ??? ????? ???? ???? ?? | ???, ContextMenu class shortcut Menu ?? ??????? ??? Context Menu ?????? ?? ???, ?? ??? control ContextMenuStrip Windows form ??? ????? ???? ??? Context Menu Menu Bar ?? ????? ???? ???? ??? | Context Menu ?? ???? ???? ?? ??? ?????? ???? ?? ???? ?? ???? ??? |?? ?????? ?? ????? ???? ???? ?? textbox ?? ???? ????? ???? ?? context menu ????? ???? ??? | Context menu ??????? ???? ?? ??? ????? ????? ?? ???? ????:1. ???????????? ?????? ???????? 2008 ?? open ?????? ?2. File menu ??? ?? New Project ?? ????? ?????3. ??? Windows application ??????? ??????| 4. ToolBox ??? ContextMenuStrip ?? ????? ??? add ?????? ?? ContextMenuStrip ?? double click ?????? |5. Context Menu ????? ??? attach ?? ???? ?? ??? ???? ????? “Component Tray” ??? ????? ???? ??|6. Windows Form ??? TextBox control ?? add ??????| ???? MultiLine ????????? ?? True ??? ?????? |7. Context Menu ?? TextBox ?? associate ???? ?? ??? TextBox ?? ????????? “ContextMenuStrip” ????? ??? ????????? ??? ?? ContextMenuStrip ?? ??? select ?????? |8. ContextMenuStrip ?? ????? ?????? | Context Menu ??? Menu Items Cut, Copy ??? Paste ?? add ?????? |9. Menu Items Cut, Copy ??? Paste ?? ??? Code ????? |Public Class PopUpMenuPrivate Sub CutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles CutToolStripMenuItem.ClickTextBox1.Cut()End SubPrivate Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles CopyToolStripMenuItem.ClickTextBox1.Copy()End SubPrivate Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles PasteToolStripMenuItem.ClickTextBox1.Paste()End SubPrivate Sub MsgboxToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MsgboxToolStripMenuItem.ClickMsgBox("Welcome Students")End SubEnd Class3088640-13081073025-54610 Database Connectivity – Introduction???????? ??????? ???, ??????? ??????????? ?? ???? ?? ????? ?????? ?? ??????? ????? ?? ???? ??????? ????????? ?? ????? ?? ??? ????? ??????? ???? ??? | ??? ?????????? ??????????? ?? ?? ??? ?????? ??? ???? ?? ?? ??????? ??? organize ?? ????? ???? ?? ????? ???? ?? ????? ??????????? ?? ????? ????? ?? ????? ?? ??? ????? ??????? ???? ?? ??? | ???? ????????? ?????? ?? ??? ??? ?? ??????? ??????? ??? ???????? ???? ??? ??????? ??????? ?? ???? ??????? ???? ?? ???, ???? ?? application ????? ?? ????? ???? ?? ?? ?? ??????? ?? ?????? ???? ?? ??? ?????? ???? ?? ?? ??????????? ??????? ???? ?? | ?? ???? ?? ?? .NET Application ??????? ?? ????? ??????? ?? ???? ????????, ?????? ?? ???? ????? ???? ?? ??? ?????? ???? ??? | ?? ????? ??? ActiveX Data Object .NET ???? ?? | ?? Classes ?? ?? ??? ???? ?? ?? ??? ?????? ???? ??? ?? ??? ????? ????? ???? ?????? ?? ??? ???? ???? ?? | ?? ???????? ???????? ????????? ?? ?? ??????? ?? interact ???? ?? ?????? ???? ?? | ??? ?? ????? ???? ??????? ?? ?????? ??? ?? ????? ?? ???? ??? ??? ??????? ?? ??? ??????? ?????? ?? communication ?? ???? ???? ??????? ?????? ?? interact ???? ?? ??? SQL ?????? ??? Stored Procedure ?? ?????? ???? ??? | ???? ??? XML ?? ?????? ???? ?? | Object Record Set Object ?? ?????? ???? ???? ?? ????? ?????? ADO ??? ???? ???? ?? | ADO (ActiveX Data Object) ?? successor ?? | ?? ?????? ????????? Disconnected Architecture ??? XML Integration ??? | ?? ????????? / Features of ?????????? ????????? ?????? ???? ??:Disconnected Architecture: disconnected architecture ?? ????? ???? ??| ????????? ??????? ?? ??? ?????? ???? ??? ?? ???? ??????? ?? ????? ???? ?? | ?? ???? ??????? ?? ???? ?? ?? ??????? ?? ??????? ??? ?? ???? ???? ?? | ?? ???? ????? ???? ?? ?? ??????? ???? ??????? ???? ???? ???Data cached in Datasets: Dataset ???? ?? ?????? ???? ?? ?? ?? ???? ?? ??????? ?? disconnected architecture ?? ???? ???? ?? | disconnected architecture ?? ?????? ???? ?? | ????? ??????? ?? ???????? ??????? ?? ??????? ???? ?? ??? ????????? ?? ??????? ?? interact ???? ???? ???? ??? ???? ?????? ?????? ???? ??????? ?? dataset ??? ???????? ???? ???? ??? Dataset ??????? ??????? ?? ?? cached set ??? ?? dataset ??? ???????? ??????? ?? ??? ??? ?????? ??? ?? ???? ??? ???? ?? ???????? ???? ?? ??? ??? ???? ????Data transfer in XML format: XML ??? ???? ???????? ???? ?? ??? ????? ??????? ??? XML ?? ????? ?? ???? ?? ??????? ?? dataset ??? dataset ?? ???? component ??? ??????????? ???? ???? ?? |Interaction with the database done through data commands: ??????? ?? ??? ?????? data command ?? ?????? ?? ?????? ???? ???? ??? ? data command ?? sql statement ?? stored procedure ?? ???? ?? | Data Command ?? execute ?? ???? retrieve, insert, delete, ??? modify ?? ???? ??? |Architecture of and Different Components of architecture ??? ???? components ?? ???? ????? ??? ????????? ???? ??? ??:Figure: Architecture???? ?? ?????? ???? ?? ??? ??? generic classes System.Data Namespace ??? ????? ???? ??? | ?? ??????????? ??? ??????? ?? component ???? ???: 1. Datasets2. Providers DataSet ?? ????? Classes ?? ????????? ????? ???? ???????? ??:DataSet: DataSet ?? ??????? ???? ??????? ???? ?? ?? ?? ?? Container ?? ??? ????? ???? ??? Dataset ?? disconnected data access model ?? ?? ?????? ??? DataSet ??? ?? ?? ???? ???? ?? ??????? ?? ????? ?? ???? ???? ?? data ?? collection ?? represent ???? ?? ?? ?? Datasource ?? retrieve ???? ???? ??? ?? DataTables collection ?? DataRelationCollection ?? contain ???? ??? ??? Data Adapter ?? ??? ?????? ???? ???? ??? ?? ?? ??? object ?? ?????? data ?? ?? ??? store ???? ?? ??? ??? ????? ?? manipulate ???? ?? ???? ??? ???? ??? datasource ?? connection ?? open ???? ?? ???????? ???? ???? ?? | DataTable: DataTable ???? ?? ????????? ?? ??????? ?? ????? ?? ????????? ??? ??? ????? ???? ?? ??? ?????? ???? ???? ???DataRow: DataTable ??? ?? ??????? ?? ?????? ?? ??????? ??|DataColumn: DataTable ?? ?? ????? ?? ????? ?? ??????? ??|DataRelation: ?? DataSet ??? ??????? Tables ?? ??? ????? ?? ??????? ???Constraint: ?? Constraint ?? ?????? ?? ??????? ?? ?? ?? ????? ????? ?? ????? ?? ???? ???? ???? ?? | ??? ??? ??????? specific classes ?? ????? ???? ???| ???? ???? ?? ?? ??????? ??????? ?????? ????????? ???? ????? ??????? ?????? ?? ??? optimized classes(or driver) ?????? ????? ?? | ?? ??? ?? classes ?? ??? provider ?? .NET Framework Data Provider ??? ???? ??? Data Provider Framework ?? ???? ?????????? ???? ?? | Provider ?? ??????? ?? ?? ?????? ????? .NET ????????? ?? ??? ???? ??????????? ???? ?? ??? ????????? ???? ??? ?? ?? ??????? ?? ??????? ??????? ???? ?? ???? ??????????? ???? ?? ??? ????????? ???? ?? ? Model ??? ?? ?????? ?? Proveder ?????? ???:1. SQL provider: SQL Server ?? ??? data transfer ?? ??? ?????? ???? ???? ?? ? SQL Server data provider classes System.Data.SqlClient Namespace ??? ??????? ???? ??? |2. OLEDB provider: ??????? ?????? ?? ??????? ???? ?? Oracle ??? MS Access ?? ??? data transfer ?? ??? ?????? ???? ???? ?? ? OLEDB data provider classes System.Data.SqlClient Namespace ??? ??????? ???? ??? | Core object ????? data provider ???? ??, ?? ?????? ???:Connection: ???? ????? ???? ????? ?? ??????? ??????? ???? ?? ??? ???? ???? ?? | ?? ?????? ?? Connection Class ?????? ???? ?? | SqlConnection Class ?? ????? MS Sql Server ??????? ?? ??????? ??????? ???? ?? ??? ???? ???? ?? | OledbConnection Class ?? ????? ??????? ??????? ???? MS Access ??? Oracle ?? ??????? ??????? ???? ?? ??? ???? ???? ?? | ?? Connection path connection string ?? ?????? ???? ???Command: ?? ?? ?? ?????????? component ?? ????? ?????? SQL Statements ?? execute ???? ?? ??? ???? ???? ??? ?? connection object ?? define ??? ?? data source ?? SQL statements ?? execute ?? data ?? manipulate ???? ??? ?? ??? ?????? ?? SQL statements ?? execute ???? ???DataAdapter: ?? data provider ?? ?? main part ??? ?? Dateset ?? DataSoruce ?? ??? communication ?? ??? ?????? ???? ???? ??? DataAdapter ?? dataset ?? ??? ?????? ???? ???? ??? ?? ????? objects ????? data access ?? data manipulation provide ???? ??? DataAdapter Class ??????? ?? ?????? ???? ??, ???? fetch ???? ?? ?? DataSet ?? fill ???? ?? | DataAdapter ??????? SQL statements ????- Select, Insert, update ?? delete operation ?? Datasource ?? ???? perform ???? ???DataReader: DataReader ?? ??? Object ?? ?? ???? ????? ?? ???? ?? read ???? ?? ?? ????????? ?? ?????? ???? ?? | DataReader Connected Architecture ??? ????? ???? ?? | ?? ??????? ?? ??????? read ???? ?? ?? ????????? ?? ??? ?? ???? ??, ???? ??? ???? ??????? read ???? ?? | ?? read only ??? forward only ???? ?? | ?? ????? ??????? ?? ??? ???? ?? ???? | ??? ?? ?????? ?? DataReader ???? ???, SqlDatareader ??? OledbDataReader |Data ControlData Control ??????? ????????? ?????? ???? ??? ????? ???? ??? | Data Control Tool Box ??? Data Control tool ?? ????? ?? create ???? ??? | ?? Data Control ?? ??? ?? ?? ??????? ?? ?? ???? ?? ?? ????? ?? ??? ???? ???? ??? ?? ?? Two Step ????????? ??: ???? step ??? data control ?? ????? ?? place ???? ??? | ????? step ??? ??????? ???? ?? ???? ?? ???? ???? ?? ??? ????????? ??? ???? ???| DataGridview, DatSet ??? Data Control ?? ?????? ??? | DataGridView ???? ?? ????????? ???? ?? ??? ?? customizable table ?????? ???? ?? | ?? ??????? ?????? ????? ?? tabular data ?? ?????? ?? ??? ?? ????? ?????? ?? ??? ??? ?????? ???? ??? ?? | ???? ??? ?? DataGridView class cells, rows, columns, ??? borders ?? ???? ????????? ?????? ???????? ???? ?? ?????? ???? ?? |DataGridView rows & column ?? ??? ???? ?? | Gridview control ??? Row ??? Column header ?? ???? ??? |Gridview Control ?? ??? ??????? properties, methods ??? events ?????? ???? ???? ??? |DataGridView ?? ??? ???? ??????????:Name: Datagridview control ?? ??? ??? ?? ???? ??? | Backcolor: Datagridview control ?? ?????????? ??? ??? ???? ??? |Forecolor: Datagridview control ?? ????? ??? ??? ?? ???? ??? |(4) Visible: ?? ????????? ????????? ???? ?? ?? Datagridview control ????? ???? ?? ???? |(5) Enabled: DatagridView Enable ???? ?? ???? |(6) Datasource: ??????? ???? ?? ??? ??? ???? ???? ?? |(7) Data Member: ??????? ???? ?? ??? ??? ???? ???? ??| DataGridView(Data Control) Control ??? ???? display ???? Imports System.Data.OleDbPublic Class Form2Dim con As OleDbConnection = NothingDim ds As New DataSet116Dim da As OleDbDataAdapter = NothingDim constr As String = "Provider=Microsoft.ACE.OLEDB.12.0;datasource=d:\StudentDB.accdb;"Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.Clickcon = New OleDbConnection(constr)con.Open()Dim str As String = "Select * from Student"da = New OleDbDataAdapter(str, con)da.Fill(ds, "Student")DataGridView1.DataSource = ds.Tables("Student")con.Close()End SubEnd ClassData Bound ControlData Bound Control ?????? ????? ???????? ???? ??? ??????? data component ?? ??? ????? ?? bind ???? ?? ???? ?? | Data Bound Control ??? ???????? ???? ??? ????? ????? ??????? ?? ??????? ?? ?????? ???? ?? | Data Bound Control ???? ?? Label, TextBox ??????? ???? ?? ????? ?? ???????? ???? ?? ????????? ???? ??? | ?? ????????? ?? ???? ?? Data Bound Control bind ?? ??? ????? ?? content ?? ????????? ????? | Data Bound Control ?? ??? ?????????? ?? ???? ???, ????? ?? Data Component ?? ??? ??? ??? ?? ???? ???? DataSource ??? DisplayMember ?? ?????????? ?????????? ??? |???????? ?? ?? data bound control ?? ???? ??? ???? - Label, TextBox, CheckBox, ListBox, ComboBox, PictureBox, DataGridView ??? |Data Bound Control ?? ???? ????????? ???? ?? ??? ????? ????? ?? ???? ????:Microsoft Visual Studio 2008 ?? open ?????? |?? ??? Windows Application Project ??????? ?????? |Add any Data Bound Control on formSelect DataSource from Property – Add New Data SourceIn wizard window1: select Database and click to NextIn Wizard window2: Select Data connection. You can choose new conncetion or any Existing connection also. Click Next.Select Connecting String Name. Click NextSelect Tables, views etc. and click To FinishData Control ??? Data Bound Control ??? ????Data ControlData Bound Control?? Data Control ?? ??? ?? ?? ??????? ?? ?? ???? ?? ?? ????? ?? ??? ???? ???? ????? Data Bound Control ??????? ?? ???? ?? ?? ????? ?? bind ???? ???? ?? |???? ??? ??? prefix “dat” ???? ?? ???? ??? ?? prefix ??? ?? ???????? ?????? ?? ??? ??, ?? ?? ?????? ???? ?? ??????: DataGridView??????: ComboBox, ListBox ??? OLEDB ??? ???? ????? OLEDB ?? ????? ??? Object Linking and Embedding Database ?? | .NET Framework Data Provider ?? ?????? ?? ???? ????? ?? ???? ?????? ?? ???? ??? | OLEDB Provider ?? ?????? ??????? ?????? ?? ???? ????? (both relational and non-relational data) ?? ???? ?????? ???? ?? ???? ?? | OLEDB ?? API ?? ?? ???????????? ?? ?????? ?????? ?? ??? ?? ????? ?????? ??????? ?????? ?? ???? ????? ?? ?? ????? ????? ?? ?????? ???? ???? ?? | ?? ?? ??????? ?? ??? ?? ?? COM (Component Object Model) ?? implement ???? ??? ?? | ???? ????? MS Access ?? Oracle ???? ??????? ?????? ?? ??????? ??? ???? ????????? ???? ?? ??? ???? ???? ?? | OLEDB Provider ?? Classes System.Data.OLEDB Namespace ??????? ???? ??? | ???? ?? ??? Classes ?? ??? ???: OleDbCommand, OleDbConnection, OleDbDataAdapter, OleDbDataReader ??? |ADODB ??? ???? ????? ADODB ?? ????? ??? ActiveX Data Object ?? | ?? Component Object Mode ?? Object ?? ??? ???? ?? ????? ?????? ???? ????? ?? ?????? ???? ?? ??? ???? ???? ?? | ?? ???????????? ???? ??? OLEDB ?? ??? ?? ???? ?????? ???? ?? | ??? ?? ADO ?? ?????? ?? ??? ??? ?? ??????? ?? ?????? ???? ?? ??? SQL ?? ????? ?? ???????? ???? ???? | ADODB ?? generic (COM) database library ?? ?? ?? ???????????? ???????? Visual basic ??? C++ ?????? ???? ?? ?????? ?? ??????? ????? ??? OLEDB Provider ?????? ???? ??? ??, ?? ?????? ???? ?? ??? ?????? ?? ???? ?? | ?? recordset object ?? ?????? ???? ?? ?? ?? ?? ???? ?? ??? ????????? ?? represent ???? ?? |ODBC and OLEDB ??? ???? OLE DB ??? ODBC ????? specifications ?? ???????????? ?? ???? ?????? ?? ??? ?????? ???? ?? | ODBC ?? ????? ??? Open Database Connectivity ?? ???? OLEDB ?? ????? ??? Object Linking and Embedding ?? | ODBC ?? ?????? relational database(SQL Data) ?? connection ?? ??? ?????? ???? ???? ?? ???? OLEDB ????? relational ??? non-relational database ?? connection ?? ??? ?????? ???? ???? ?? | OLEDB, ODBC ?? successor ??, OLEDB software component ?? ?? ??? ?? ?? front-end ???? graphical user interface based on VB,C++, Access ?? ???? ?? back-end ???? SQL Server, Oracle, DB2, mySQL ??? ?? ?????? ???? ?? ?????? ???? ?? |OLEDB Component based specification ???? ??| ODBC procedure based specification ???? ?? |?? ?????? ??? OLEDB components ?????? ODBC ?? ????? ??? improved performance ?????? ???? ????ODBC ?? ??? Data Source Name ?? DSN ?? ????? ???? ?? ???????? ???? ?? | OLEDB ?? ??? DSN ?? ???????? ??? ???? ?? |Data access using ?? ????? ?? ???? ?? ?????? ?? ?????? ???? ?? ??? ????? ??? ???? ???:??????? ????? ?? ??? connection string define ????connection string ?? ????? ?? ??????? ?? ??? connection(SqlConnection, OleDbConnection, etc) define ???? command(SqlCommand, OleDbCommand, etc) ?? command string ?? define ???? ????? Sql query ????? ???? ?? | command string ??? connection object ?? ????? ?? Data Adapter(SqlDataAdapter, OleDbDataAdapter, etc) define ???? |??? DataSet object create ???? |??? ????? “Select” ??, data adapter ?? ?????? query ?? ?????? ?? dataset ko fill ???? |DataRow ??? DataColumn object ?? ????? ?? DataSet ??? Data Table ?? ??????? ?? read ???? |??? ????? “Update”, “Insert” ?? “Delete” ?? ?? data adapter ?? ?????? dataset ?? update ???? |Dataset ??? ???? ??? ???????? ?? ??????? ??? ??? ?????? |MS Access ??? ??????? ???? ????? MS Access ??? ??????? ???? ????? ?? ??? ????? ????? ?? ???? ????:Start?All Programs?Microsoft Office 2007 ?? ????? ?????? |Microft Office Access 2007 ?? ??? ?????? |Office Button ????? ?? New option ?? ????? ?????? |Blank Database ?? ????? ?? ???? ?? ??? ???? ??????| ???? ??? Create Button ?? ????? ?????? | Table Design view ???, field name ??? ???? data type ???? ?????? |6. ??? ??? Table ?? save ?????? |7. ??? ?? ?? ???? Table ????? ????? ??? ?? Table Design view ?????? ??????? ?????? ?? ??? ?? save ?????? |Database Operation??????? ??? ??????? ?????? ???? Insert, Delete, Update, Navigate, Display (Retrieve) ?????? ???? ???? ??? | ???? ??? front end ??? ????? ?????? ?????? | ??? ?? back end ?? ??? MS Access ??????? ?? ????? ?? ???? ??? ?? ???? ??????? ??????? ?? ??????? ???? create ?????? | ???? ?? MS Access ??????? ?? ????? ???? ??? ?? ??? ??????? ?????? ?????? ???? ??? ????? coding ????? ??: Insert ?? ?????? Imports System.Data.OleDbPublic Class Form1 Dim con As OleDbConnection = NothingDim cmd As OleDbCommand = NothingDim constr As String = "Provider=Microsoft.ACE.OLEDB.12.0;data source=d:\StudentDB.accdb;"Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnInsert.ClickDim rows As Integer = 0con = New OleDbConnection(constr)con.Open()Dim str As String = "Insert into Student values(" & txtRoll.Text & ",'" &txtName.Text & "','" & txtAddress.Text & "','" & txtEmail.Text & "')"cmd = New OleDbCommand(str)cmd.Connection = conrows = cmd.ExecuteNonQuery()If rows > 0 ThenLabel6.Visible = TrueLabel6.Text = "Records inserted successfully"ElseLabel6.Text = "Records not inserted"End IfEnd SubEnd Class Update ?? ?????? Imports System.Data.OleDbPublic Class Form1 Dim con As OleDbConnection = NothingDim cmd As OleDbCommand = NothingDim constr As String = "Provider=Microsoft.ACE.OLEDB.12.0;data source=d:\StudentDB.accdb;"Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnUpdate.ClickDim rows As Integer = 0con = New OleDbConnection(constr)con.Open()Dim str As String = "Update Student Set SRoll =" & txtRoll.Text & ",SName='" &txtName.Text & "',SAddress='" & txtAddress.Text & "',SEmail='" & txtEmail.Text &"'"cmd = New OleDbCommand(str)cmd.Connection = conrows = cmd.ExecuteNonQuery()con.Close()If rows > 0 ThenLabel6.Visible = True113Label6.Text = "Records Updated successfully"ElseLabel6.Text = "Records not updated"End IfEnd SubEnd ClassDelete ?? ?????? Imports System.Data.OleDbPublic Class Form1 Dim con As OleDbConnection = NothingDim cmd As OleDbCommand = NothingDim constr As String = "Provider=Microsoft.ACE.OLEDB.12.0;data source=d:\StudentDB.accdb;"Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnDelete.ClickDim rows As Integer = 0con = New OleDbConnection(constr)con.Open()Dim str As String = "Delete from Student where SRoll=" & txtRoll.Text & " "cmd = New OleDbCommand(str)cmd.Connection = conrows = cmd.ExecuteNonQuery()con.Close()If rows > 0 ThenLabel6.Visible = TrueLabel6.Text = "Records Deleted successfully"ElseLabel6.Text = "Records not Deleted"End IfEnd SubEnd ClassNavigation ??? Display ?? ?????? Imports System.Data.OleDbDim con As OleDbConnection = NothingDim ds As New DataSetDim da As OleDbDataAdapter = NothingDim index As Integer = 0Dim constr As String = "Provider=Microsoft.ACE.OLEDB.12.0;datasource=d:\StudentDB.accdb;"Private Sub Form1_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Loadcon = New OleDbConnection(constr)da = New OleDbDataAdapter("select * from Student", con)da.Fill(ds, "Student")If ds.Tables(0).Rows.Count = 0 ThenElsetxtRoll.Text=ds.Tables("Student").Rows(0).Item("SRoll").ToString()txtName.Text=ds.Tables("Student").Rows(0).Item("SName").ToString()txtAddress.Text=ds.Tables("Student").Rows(0).Item("SAddress").ToString()txtEmail.Text=ds.Tables("Student").Rows(0).Item("SEmail").ToString()End IfEnd SubPrivate Sub btnFirst_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnFirst.ClickIf index = 0 ThenLabel6.Visible = TrueLabel6.Text = "You are already at First record"ElseLabel6.Visible = FalsetxtRoll.Text = ds.Tables(0).Rows(0).Item(0).ToString()txtName.Text = ds.Tables(0).Rows(0).Item(1).ToString()txtAddress.Text = ds.Tables(0).Rows(0).Item(2).ToString()txtEmail.Text = ds.Tables(0).Rows(0).Item(3).ToString()End IfEnd SubPrivate Sub btnNext_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnNext.ClickIf index = ds.Tables(0).Rows.Count - 1 ThenLabel6.Visible = TrueLabel6.Text = "You are already at Last record"ElseLabel6.Visible = Falseindex = index + 1txtRoll.Text = ds.Tables(0).Rows(index).Item(0).ToString()txtName.Text = ds.Tables(0).Rows(index).Item(1).ToString()txtAddress.Text=ds.Tables(0).Rows(index).Item(2).ToString()txtEmail.Text = ds.Tables(0).Rows(index).Item(3).ToString()End IfEnd SubPrivate Sub btnPrev_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnPrev.ClickIf index = 0 ThenLabel6.Visible = TrueLabel6.Text = "You are already at First record"ElseLabel6.Visible = Falseindex = index - 1txtRoll.Text = ds.Tables(0).Rows(index).Item(0).ToString()txtName.Text = ds.Tables(0).Rows(index).Item(1).ToString()txtAddress.Text=ds.Tables(0).Rows(index).Item(2).ToString()txtEmail.Text = ds.Tables(0).Rows(index).Item(3).ToString()End IfEnd SubPrivate Sub btnLast_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnLast.ClickIf index = ds.Tables(0).Rows.Count - 1 ThenLabel6.Visible = TrueLabel6.Text = "You are already at Last record"ElseLabel6.Visible = Falseindex = ds.Tables(0).Rows.Count - 1txtRoll.Text = ds.Tables(0).Rows(index).Item(0).ToString()txtName.Text = ds.Tables(0).Rows(index).Item(1).ToString()txtAddress.Text=ds.Tables(0).Rows(index).Item(2).ToString()txtEmail.Text = ds.Tables(0).Rows(index).Item(3).ToString()End IfEnd SubEnd Class ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download