Quantcast
Channel: AMAZING SECRETS OF HACKING » visual basic
Viewing all articles
Browse latest Browse all 3

Tool Box

$
0
0

In this class, we begin a journey where we look at each tool in the visual basic toolbox. We will revisit some tools we already known and learn a lot of new tools. First, though, we look at an important visual basic function.

The Message Box

One of the best functions in visual basic is the message box.The message box is displays a message, optional icon and selected set of command buttons. The user responds by clicking a button.

The statement form of the message box returns no value

MsgBox Message, Type, Title

where

Message Text message to be displayed
TypeType of message box (discussed in a bit)
TitleText in title bar of message box

You have no control over where the message box appears on the screen.

The function from of the message box returns an integer value ( corresponding to the button clicked by the user).

Dim Response as Integer
Response = MsgBox (Message, Type, Title)

The type argument is formed by summing four values corresponding to the buttons to display, any icon to show, which button is the default response, and modality of the message box.

Capture

Capture1

Capture2

 

Object Methods

In pervious work, we have seen that each object has properties and events associated with it. A third concept associated with objects is the method. A method is a procedure or function that imparts some action to an object.

As we move through the toolbox, when appropriate, we will discuss methods.Methods are always enacted at run-time in code. The format for invoking a method is:

ObjectName.Method{optional arguments}

Note this is another use of the dot notation.

The Form Object

Capture 3

Capture4

The Form is where the user interface is drawn. It is central to the development of visual basic applications.

Command Buttons

We have seen the command button before.It is probably the most widely used control. It is used to begin, interrupt or end a particular process.

Command Button Properties:

Capture5

Capture

 
Text Box

A text box is used to display information entered at design time, by a user at run time, or assigned within code.
The displayed text may be edited.

 

Capture2

Check Boxes

Check boxes provide a way to make choices from a list of potential candidates. Some all or none of the choices in a group may be selected.

Check Box Properties:

Caption Identifying text next to box
Font Sets font type, style, size
value Indicates if unchecked, checked or grayed out

 

The post Tool Box appeared first on AMAZING SECRETS OF HACKING.


Viewing all articles
Browse latest Browse all 3

Trending Articles