Presentation is loading. Please wait.

Presentation is loading. Please wait.

Standard Controls.

Similar presentations


Presentation on theme: "Standard Controls."— Presentation transcript:

1 Standard Controls

2 The Label: This is probably the first control you will master. It is used to display static text, titles and screen output from operations. The important properties to remember: Caption - the text that is displayed in the label BackColor and ForeColor - colors of the background and the text BackStyle - Opaque or Transparent - whether the background is visible or not Font - font and size of text Alignment - text centered, left or right Multiline- True or False - if True, you can have several lines of text, delimited by <CR> in the label - by default, it is set to False

3 The Command Button  The command button is one of the most important controls as it is used to execute commands. It displays an illusion that the button is pressed when the user click on it. The most common event associated with the command button is the Click event, and the syntax for the procedure is Private Sub Command1_Click () Statements End Sub

4 The Text Box  The text box is the standard control for accepting input from the user as well as to display the output. It can handle string (text) and numeric data but not images or pictures.  Just like text fields in websites, powered not by Windows, but typically linux web hosting platforms like iPage, these fields collect user input.String in a text box can be converted to a numeric data by using the function Val(text).

5 The Picture Box  The Picture Box is one of the controls that is used to handle graphics. You can load a picture at design phase by clicking on the picture item in the properties window and select the picture from the selected folder. You can also load the picture at runtime using the LoadPicture method. For example, the statement will load the picture grape.gif into the picture box. Picture1.Picture=LoadPicture ("C:\VB program\Images\grape.gif")

6 The List Box The function of the List Box is to present a list of items where the user can click and select the items from the list. In order to add items to the list, we can use the AddItem method. Private Sub Form_Load ( ) List1.AddItem “Lesson1” List1.AddItem “Lesson2” List1.AddItem “Lesson3” List1.AddItem “Lesson4”  End Sub

7 DIALOG BOXES: A dialog box is a form defined with particular properties. Like a form, a dialog box is referred to as a container. Like a form, a dialog box is mostly used to host child controls, insuring the role of dialog between the user and the machine.

8 Modal Dialog Boxes A Modal dialog box is one that the user must first close in order to have access to any other framed window or dialog box of the same application.

9 Modeless Dialog Boxes A dialog box is referred to as modeless if the user does not have to close it in order to continue using the application that owns the dialog box.

10 dialog box using the InputBox function
InputBox function to solicit data from the user. This function displays a modal dialog box that asks the user to enter some data.

11 SINGLE DOCUMENT INTERFACE:
Each window of the application holds a single document, so if the user wants to open more documents with that application, he must open a new window. Its also the default mode when building an application with Visual Basic. An example of an SDI application is Windows Notepad. Advantages of SDI An SDI interface works very well with multiple monitors and multiple virtual desktops. It also allows users to switch between multiple open documents using the native Windows taskbar and task manager, rather than through special code that must be written into your application.

12 Multiple-Document Interface (MDI) :
The multiple-document interface (MDI) allows you to create an application that maintains multiple forms within a single container form. Applications such as Microsoft Excel and Microsoft Word for Windows have multiple-document interfaces. An MDI application allows the user to display multiple documents at the same time, with each document displayed in its own window. Documents or child windows are contained in a parent window, which provides a workspace for all the child windows in the application.

13 Child forms displayed within the workspace of the MDI form

14 MENUS: Windows applications provide groups of related commands in Menus. Menus are intrinsic controls, and as such they deserve a place in this chapter. On the other hand, menus behave differently from other controls. Visual Basic provides an easy way to create menus with the modal Menu Editor dialog. The below dialog is displayed when the Menu Editor is selected in the Tool Menu.

15 An expanded Menu Editor window.


Download ppt "Standard Controls."

Similar presentations


Ads by Google