VB-oriented objects and their properties and methods Event

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/bskls/article/details/102529440
                    VB中面向对象及其属性方法与事件

Object-Oriented
Object
VB is a typical process-oriented language. Object-Oriented (oop-object oriented programming) programming is object-based, event-driven programming techniques to target the event processing. "Everything Is an Object." In real life, things can be used as "object" of our subjective consciousness, a cell phone, an apple, a person, a car ... we are "objects." The object is real, the angle of view from VB programming, an object is both contain data, the method further comprises the data receiving operation after the event, and encapsulated in a separate logical entity. Object has its own properties, methods and events.
VB event is the most commonly used forms and controls. For example: Command, Label, Form, and so on. They have their own properties, methods and events.

Property
attribute object better understood property refers to properties of the object , it is used to describe the object 's. For example, "person" is an object, "fat, thin", "height", "black and white", "beauty and ugliness," are all "human" attributes, different objects have different properties , the properties can be distinguished with different characteristics the "people", empathy can attribute to distinguish between different objects.
VB attribute definition object for "title", "color", "size", "font", "position" and the like. When programming, there are default property , i.e., property of an object has a default value , can be adjusted by changing the setting.

Method
in VB object method I think it is more difficult to understand in the beginning, I understand some deviation, that is the way the If statement, it is not true, by the system has been designed, in preparation of some special event that can be used program, complete the display , move , hide , output object like a certain operation function. Each object has a certain way, different objects have different methods, methods of content is not visible , common methods are Print, Show, Move, etc.

Events
Events are objects that can identify and make external stimulation. Different different object recognition event, the form can not only identify the click event but also to identify double-click events, but only recognizes the command button click event. Form of Common events include: the Load the Activate, the Click, the DblClick . Command button Common events include: the Click . Labels and text boxes commonly used in the event of a Change .

Below I will give some life in the common examples to help me and you have to go to a better understanding of object-oriented and object properties, methods, events.
With "Newton's Apple" as an example of it, the "Newton's Apple" look for the object, "weight", "Color", "taste" is its property, "you can eat" "can beat" its approach, "is Newton bite "event, Apple's reaction made the object, that event processing is Apple being eaten.
Event: The object is Newton's apple
is an external stimuli Newton bite
the apple is eaten is a process
which constitute an event

Then to Xiao Ming, for example, "appearance", "sound", "height" is his property, "can run" "could hear gunshots start" is his method.
Event: Xiao Ming is subject
heard gunshots outside stimuli is
Xiao Ming ran to the finish is a process
which constitute a whole event.

These are my objects and properties, methods, understanding of events, thank you.

Guess you like

Origin blog.csdn.net/bskls/article/details/102529440