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
steps of connecting database from vb6.0

Create a Visual Basic that allows a user to play a variation of Hangman. User Inputs The user types a letter into the textbox.   Functional Items 1. Read a

Deleting Records: To remove a record use the Delete method. To delete the record from the customer table follow the coding as shown below: data1.RecordSource = "Customer"

MENUS AND TOOL BARS   The Menu options can be checked, enabled, disabled, and popped up on an object. The Menu Object: The Menu control is used to generate a menu in

SDK PROGRAMMING The SDK programming is a developing Win 32 based programs using the Win 32 API that directly interact with the hardware. Therefore the execution of the SDK prog

Steps for Creating A MDI Form: 1. Build a new form and set IsMdiContainer property to true. 2. Build a child form class to add to the form. 3. Now Right click the proj

FEATURES OF USER INTERFACE DESIGN The features like how will the software's are used? Who will be the users? What will be the life of the software? During its lifetime how ofte

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

( Wage Calculator with Tax Calculations) Develop an application that calculates an employee’s earnings, as shown in Fig. 4.23. The user should provide the hourly wage and number of

Hungarian Notation: The Hungarian Notation was invented by Charles Simonyi from Microsoft. It is a naming convention. It is a reminder of the type of a variable. The Handles h