Unformatted text preview:

VB .NETPowerPoint PresentationThe .NET FrameworkWriting Windows Applications with VBProgramming LanguagesObject ModelObject Model (cont.)Dot NotationIntellisenseVB Application FilesVisual Studio EnvironmentVisual Studio IDE Start PageSlide 13Slide 14IDE New Project DialogIDE Main WindowSlide 17VB ToolboxVisual Studio HelpModesNaming Rules – HandoutRecommended Naming Conventions for VB ObjectsSteps for Writing VB ProjectsForm Design PlanProperties Design PlanEvent Design PlanSet the Project's Startup ObjectWrite the CodeEditor WindowRemark StatementTest and DebugFinding and Fixing ErrorsAssignment StatementEnding a ProgramButton (btn)Text Box (txt)Check Box (chk)Radio Button (rad)Data TypesSlide 40Variables & ConstantsConstantsDeclaration StatementsDeclaration ExamplesType-Declaration CharactersVariables – Scope & LifetimeDeclaring Module Level Variables ExampleCalculationsConversion Functions (cont.)Conversion Examples (also review info p 485)Mathematical OperatorsMathematical Order of OperationsOption ExplicitOption StrictFormatCurrency FunctionFormatNumber Function – pg 499Named Formats - FormatDateTime FunctionHandling ExceptionsTry/Catch Blocks - pg 488Try Block - General FormTry Block - Example 1 Catches All ExceptionsTry Block - Example 2 Catches Specific ExceptionTry Block - Example 3 Catches Multiple Specific ExceptionsMessageBox ObjectMessageBox SyntaxMessageBoxButtons ConstantsMessageBoxIcon ConstantsSlide 68VB .NETThe BasicsThe .NET FrameworkCommon Language RuntimeManaged CodeMS Intermediate Language – MSILJIT CompilerCommon Type SystemCommon Language SpecificationClass Libraries – NamespaceMultiple Language SupportWriting Windows Applications with VBWindows Graphical User InterfaceVB.Net is an object-oriented language Write application programs that run in Windows or on the InternetWindow = FormToolbox of elements called ControlsText BoxLabelCheck BoxButtonProgramming LanguagesProceduralProgram specifies exact sequenceEvent Driven (VB 6.0 and previous)Object Oriented Programming (VB.NET)User controls sequence•Click event•Double Click event•Change eventObject ModelObject ==> NounForm and ControlsProperty ==> AdjectiveColor of a FormMethod ==> VerbMove a FormObject Model (cont.)Event ==> Occurs when the user takes actionUser clicks a button, User moves a formClass ==> Template to create new objectEach control added is an Instance of a ClassDot NotationUsed to reference object's properties and methods in codeObject dot Property•Form.Text, TextBox.TextObject dot Method•Form.Hide( ), TextBox.Focus( )To reference an object's events use an underscore instead of a dot•Button_Click, ListBox_TextChangedIntellisenseEventMethodPropertylabel1.FlatStyle =label1.Enter() label1.Equals()VB Application FilesOne Solution File .slnMay contain multiple projectsStores the names of the project and config infoSolution User Options File .suoUser customization optionsIDE screen layout Project Files .vbprojDescribes the project and list the files requiredMay contain multiple formsProject User Options File .vbproj.userForm Files .vb /.aspxResource File for the Form .resxCode Behind .aspx.vbVisual Studio EnvironmentIntegrated Development Environment (IDE)Form DesignerEditor for entering codeCompilerDebuggerObject BrowserVisual Studio IDE Start PageVisual Studio IDE Start PageVisual Studio IDE Start PageIDE New Project DialogIDE Main WindowToolbarsDocument WindowForm DesignerSolution ExplorerProperties WindowThe Name property of a control is used to refer to the control in code. The Text property holds the words that the user sees on the screen.ToolboxIDE Main WindowVB ToolboxHolds the controls you place on a formVisual Studio HelpExtensive Help featureIncludes Microsoft Developer Network library (MSDN)Entire reference manualCoding examples Dynamic HelpTechnethttp://msdn.microsoft.com/library/en-us/vblr7/html/vboriVBLangRefTopNode.aspModesDesign TimeDesigning the interface and writing codeRun TimeTesting and running projectBreak TimeRuntime error or pauseDebugging“Look at the Title Bar”Naming Rules – HandoutAlways use standard names for objectsNumbers, letters, & underscoreMust start with letter or underscoreNo spaces or punctuation marks3 letter lowercase prefix identifies control type•Button-btn•Label-lbl•Form-frmIf multiple words capitalize 1st letter of each word – Camel casing•btnExitProgramRecommended Naming Conventions for VB ObjectsObject Class Prefix ExampleForm frm frmDataEntryButton btn btnExitTextBox txt txtPaymentAmountLabel lbl lblTotalRadio Button rad radBoldCheckBox chk chkPrintSummaryHorizontal ScrollBar hsb hsbRateVertical ScrollBar vsb vsbTemperaturePictureBox pic picLandscapeComboBox cbo cboBookListListBox lst lstIndegredientsSteps for Writing VB ProjectsDesign/Define the User InterfaceInterface Design Planning FormPlan/Set the PropertiesObject and Properties Planning FormPlan/Write the CodeEvent Procedure Planning FormOne of each of the above for each *.vb form fileTest and DebugForm Design PlanPUSH MEEXITProperties Design PlanLabelName lblMessageText leave blankButton 1Name btnPushText Push MeButton 2Name btnExitText ExitFormName frmHelloText Hello World by your nameEvent Design PlanbtnPush_ClickbtnExit_ClickSet lblMessage.text to “Hello World”Exit programSet the Project's Startup ObjectThe default startup object if Form1The name of the form should always be changed to adhere to naming rulesUsing Project menu, Properties change the startup object to match the new nameWrite the CodeWhile the project is running the user can perform actionsEach action by the user causes an Event to occurWrite code for the events you care about, the events you want to respond with codeCode is written as event proceduresVB will ignore events for which you do not write codeEditor WindowDeclarations SectionClass listMethod list' Display the Hello World messageRemark StatementAlso known as Comment, used for documentationNon-executableAutomatically colored Green in EditorBegins with an apostrophe ( ' )On a separate line from executable codeAt the right end of a line of executable codeTest and DebugSave Project - File Menu, Save AllRun ProjectDebug Menu, Start (F5) Start With Full without Debugging (CTRL F5)Correct any Errors and RerunCompile errorsRun-Time ErrorsLogic errorsSyntax errors"Help is always available from the Help Menu or by pressing F1."Finding and Fixing ErrorsSyntax ErrorsRun-Time ErrorsLogic ErrorslblMessage.Text=" Hello World


View Full Document

St. Ambrose CSCI 275 - The Basics

Download The Basics
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view The Basics and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view The Basics 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?