teacher: ms. olifer microsoft visual studio 2010: properties of windows form object

7
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

Upload: willis-hill

Post on 29-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

Teacher: Ms. Olifer

MICROSOFT VISUAL STUDIO 2010:

PROPERTIES OF WINDOWS FORM OBJECT

Page 2: Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

PROPERTIES• Splash Screen is the first image that appears

when application is started.

• Select the Windows Form object by clicking on it in the designer window.

• Example: System.Windows.Forms.Form

• A class definition is a block of code that specifies (or defines) the attributes and behaviors of an object.

• The period that separates each word in System.Windows.Forms.Form is called the dot member access operator, which indicates the hierarchy of namespaces.

Page 3: Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

PROPERTIES• You use the name entered in an object’s Name

Property to refer to the object in code. The name must begin with a letter and contain only letters, numbers, and the underscore character. You cannot use punctuation characters or spaces in the name.

• Text Property controls the caption displayed in the form’s title bar.

• StartPosition Property specifies the starting position of the form.

• FormBorder Style controls the border of the form.

• Font specifies the font used for text.

Page 4: Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

TOOLBOX WINDOW

• The Toolbox window contains the tools you use when creating your application.

• Each tool in the toolbox represents a class.

• Each tool could be modified (size, location, etc.)

• To lock the form: either click on the form FormatLock controls, or right-click on the form and select Lock.

Page 5: Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

TOOLS• You use the Label tool to instantiate a label

control. The purpose of a label control is to display text that the user is not allowed to edit while the application is running. Also used to identify other controls and display program output.

• You use the Button tool to instantiate a button control. In Windows applications, a button control is used to perform an immediate action when clicked. The name of the button should end with the word Button, which is the name of the class.

Page 6: Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

THE CODE EDITOR WINDOW

• The set of Visual Basic instructions, or code, that tells an object how to respond to an event is called an event procedure.

• The Class statement begins with the Public Class MainForm instruction and ends with the End Class instruction.

• The procedure header begins with the two keywords Private Sub. A keyword is a word that has a special meaning in a programming language.

Page 7: Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT

THE CODE EDITOR WINDOW (CON-D)

• The Private keyword indicates that the procedure can be used only within the class in which it is defined.

• The Sub keyword is an abbreviation of the term sub procedure, which, in programming terminology, refers to a block of code that performs a specific task.

• An assignment statement assigns a value to something, such as the property of a control. An assignment statement that assigns a value to the Text property of a control follows the format

control.Text = “string”

• Example – greetingLabel.Text = “Hello”