Adding events in visual basic , Visual Basic Programming

Adding Events in VB 

For adding the events in VB, first double click on the command button with the caption hello.

The Private Sub command1_Click () and End Sub would be inserted. Now type your coding within this construct.

Text1.Text = "Hello"

Private Sub command1_Click()

Text1.Text = "Hello"

With Text1

Font="Times New Roman"

.FontSize = 24

End With

End Sub

The With command relates the properties that follow with the control. (In this situation Text1).This is equivalent to the writing Text1.Font, Text1.FontSize. Double click on the command button with caption clear. And type the following code.

Private Sub command2_Click()

Text1.Text = " "

End Sub

Double click on the command button with the caption exit.

Now type the following code.

Private Sub command3_Click()

end

End Sub

This project has formed the form in show in the given figure with a textbox and 3 command buttons. The buttons have been related with the click events.

1858_command buttons.png

Figure: A Form with Command Buttons, Text Box and Accelator

Posted Date: 10/9/2012 8:05:05 AM | Location : United States







Related Discussions:- Adding events in visual basic , Assignment Help, Ask Question on Adding events in visual basic , Get Answer, Expert's Help, Adding events in visual basic Discussions

Write discussion on Adding events in visual basic
Your posts are moderated
Related Questions
A Sub procedure is a series of VBScript statements, enclosed through Sub & End Sub statements which perform actions however don't return a value. A Sub procedure can take arguments

how to make dictionary in vb using ms access

For naming anything variable names follow the standard rules in VBScript. A variable name: Should begin with an alphabetic character. Cannot have an embedded period. Sh

WINDOWS 32 BIT (WIN 32) APPLICATIONS   The Win 32 based applications are the applications developed for the windows family of the operating systems. The Win 32 applications ac

Message Routing: The system posts the messages to a first-in, first-out queue known as the message queue or it sends the messages directly to a window procedure. The Messages

VISUAL INTERFACE DESIGN Instead of the graphic nature of the program, only the visualness of the inter action is important. The program must not focus on the GUI. On the other

RESOURCES The cursors, Icons, dialog, bitmaps accelerators, menu, table tool bar and string are the different resources. The resources are compiled by the resource compiler. Th

Assume that s is a string variable that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable and displ

A variation on the If...Then...Else statement lets you to choose from various alternatives. By adding up Else If clauses expands the functionality of the If...Then...Else statement

In this unit you have learned how to develop Web pages which use VBScript. You have learned to insert logic to your Web pages as along with any other programming application. You h