1 / 131

Welcome to New Semester

Welcome to New Semester. CS-65. Session-1. Visual Basic. About Visual Basic

tex
Download Presentation

Welcome to New Semester

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome to New Semester CS-65

  2. Session-1 | | <document classification>

  3. Visual Basic | | <document classification>

  4. About Visual Basic Visual Basic is a Windows based programming Language for developing professional applications. Visual Basic is actually BASIC language, which is visual in its nature.Visual is a method used to create GUI applications.The GUI(Graphical User Interface) which enables users to interact with an application. Microsoft developed this language in 1991. | | <document classification>

  5. Features of Visual basic • Successor of BASIC language • GUI(Graphic User Interface) Support. • Very Easy and Understandable • IDE(Integrated Development Environment) • Access to Databases(Relational and non Relational) • Supports OOPS • Event Driven Language | | <document classification>

  6. Quick Development • Access to Windows API • ActiveX and OLE • Internet Support • Quick error Detection/Correction | | <document classification>

  7. Visual basic Environment The working environment in VB integrates many different functions such as design, editing, compiling and debugging with a common environment. The working environment of VB is also referred to as the Integrated Development Environment | | <document classification>

  8. Visual Basic Integrated Development Environment When you start new project, VB shows this screen. This is visual Basic Integrated Development Environment. IDE means it integrates many different functions such as design, editing, compiling, debugging within a common environment. | | <document classification>

  9. What is Project Visual Basic Programs are organized into Projects. A Project is a collection of various components. Projects contains different Forms. • The extension of Project files are (.VBP) • The Extension of Form modules files are (.FRM) • The extension of Class modules files are (.CLS) • The extension of Standard modules files are (.BAS) • The extension of Custom control files are (.VBX or .OCX). | | <document classification>

  10. Creating Project in Visual Basic There are three main steps to creating an applications in Visual Basic • Create the Interface • Set the Properties • Write the code. | | <document classification>

  11. Toolbox The set of controls available in the Toolbox.Toolbox contains controls used to customize forms. | | <document classification>

  12. Form Properties Properties means the characteristics that describe the behavior of an object or control. Control An Object or a Control has some properties such as its name, color, appearance, caption etc. known as its properties. Name Caption Enabled Height and Width | | <document classification>

  13. Project Explorer Window This window contains three buttons 1. View code 2. View Object 3. Toggle folder | | <document classification>

  14. Form Events Events are the activities that happen when an object does something. An Event is any user action directed at the application. Different Event Procedures are click, DbClick, Load, UnLoad etc. . | | <document classification>

  15. AnEvent Handlersconsists of :- three parts Private Sub Form_Click() Statements of code End Sub • The First Line ‘ Private Sub Form_Click()’ is the the event definition • The Second Line writes the code of statements • The Third Line ‘End Sub’ the end of subroutine | | <document classification>

  16. Print Command Print command used to print the message or result on the screen. print “welcome” print 10+20 | | <document classification>

  17. Basic Controls • Label Control:- This control displays text on the Form. Label Properties Name Caption Forecolor Alignment Backcolor Appearance Font | | <document classification>

  18. 2. Text Box Control: This Control used to get the data from user. Properties Name MultiLine Max Value Scrollbar | | <document classification>

  19. | | <document classification>

  20. | | <document classification>

  21. 3. Command Button The command button Control allows users to click it to perform actions. | | <document classification>

  22. | | <document classification>

  23. 4. Shape and Line Control: This controls are useful for drawing graphical elements on the surface of a form.Different shapes are available, it can be displayed as rectangle,Circle or square. The Border Color and Fill Color properties can be set to change the color, the border style, border width. Rectangle 0 Square 1 Oval 2 Circle 3 | | <document classification>

  24. Example of Shape Control | | <document classification>

  25. 4. Picture Box Control: Picture Box is an all purpose graphics container. We can use it to displays the contents of .BMP, .JPG, .GIF graphic files. 5. Image Control: Image Control is similar to the Picture Box Control but is used only for displaying Picture | | <document classification>

  26. | | <document classification>

  27. 6. Check Box A check Box provides the user with a toggle choice. It indicates whether a condition is on or off. | | <document classification>

  28. | | <document classification>

  29. 7. Combo Box It present a list of choices to the user that only the selected item is displayed. It Combine the features of Text Box and a List Box. Properties • ListIndex • Selecteditem Methods • Additem • Clear • Listcount • Style • Removeitem | | <document classification>

  30. Example of Combo Box | | <document classification>

  31. 8. List Box Control: List Box Control long lists of options from which users can choose one. By default, the choices are displayed vertically in a single column. Properties • Listindex • Selecteditem Methods • Additem • Clear • Listcount • Style • Removeitem | | <document classification>

  32. Example of List | | <document classification>

  33. 9. TIMER Control The timer Control can be used to create an event in your application at a regular interval. Property: Interval | | <document classification>

  34. | | <document classification>

  35. 10. HSrcollBar and VScrollBar Controls A Scrollbar is a indicator that lets the user select a value between the two ends of a control. Property Min Max Value Large change Small change | | <document classification>

  36. Example of Scrollbars | | <document classification>

  37. | | <document classification>

  38. File System Controls: DriveListBox, DirListBox, FileListBoxDriver DrivelistBox:- Displays the names of the drives connected to th PC. DirListBox: Displays the folders of current drive FileListBox: Displays the files of the current folder. | | <document classification>

  39. Example of Drive, Dir & File Control | | <document classification>

  40. OLE Container The OLE (Object Linking Embedding) Control is an easy way to add capabilities such as Microsoft Excel, word, Paint brush and many others | | <document classification>

  41. | | <document classification>

  42. | | <document classification>

  43. Dialog Boxes Dialog Boxes is a window used to display and accept information Dialog boxes can either be Modal or Modeless • Modal Dialog Box • ModeLess Dialog Box | | <document classification>

  44. Modal Dialog Box does not let the user continue working with rest of the application until it is closed ex- Font, Paragraph dialog box. Modeless Dialog Box lets the shift focus between the dialog box and another form without having to close the dialog box. Ex. Find dialog box | | <document classification>

  45. Predefined Dialog Boxes Visual Basic provides two predefined dialog boxes that you can use in your applications: • Inputbox Function • Msgbox Function | | <document classification>

  46. Inputbox • The InputBox function is used to input the data from user. This function displays a modal dialog box that asks the user to enter some data. syntax: inputbox(prompt,[title],[default],[xpos],[ypos],[helpfile],[context] as string | | <document classification>

  47. Example I=inputbox(“enter no”,”hello”,0) output: | | <document classification>

  48. Msgbox The Msgbox function is used to get yes or no responses from users and displays the message on the screen. It displays a message in a dialog box. Syntax for displaying Msgbox(prompt,[button],[title],[helpfile],[context]) | | <document classification>

  49. example msgbox (“hello”, ,”message”) Output: | | <document classification>

  50. Dim ans As Integer ans = MsgBox("Do you want to continue", vbYesNo, "Information") If ans = vbNo Then Unload Me Else Text1.Text = "" End If | | <document classification>

More Related