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
Message Handling: 1. The message is send to the window. And it is sent to the Window Procedure. 2. The message map holds all the message handlers. 3. The window procedur

Cdatabase Class: The CDataBase class helps to connect to the data source. The Open member function opens a connection to the data source. CRecordset class is used for performi

I am a beginner in Visual basic 2012 and making a data management programme with visual basic 2012 as front end and MySql as back end. I want to filter data grid view table with Li

1. Create a new solution file named Ch03HandsOnProject1. 2. Rename the form and set the filename of the form to frmMain and frmMain.vb, respectively. 3. Set the appropriate p

If Then Else: The control statement If Then Else is used for computing a condition and taking the action based on the condition. If the condition is true then the section will

Ask question #Minimum 10Public Class Form1 ''=============================================== ''Date: June 24, 2014 ''Author: Xochitl Nisbet ''Purpose: Convert Celsi

The following table lists suggested conventions for objects you might encounter while programming VBScript. Code Commenting Conventions All process should begin with a brie

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

You can exit a Do...Loop using the Exit Do statement. Since usually you desire to exit only in certain situations, such as to ignore an endless loop, you should employ the Exit Do

The scope of a variable is finding out by where you declare it. While you declare a variable in a procedure, only code in that procedure can access or alter the value of that varia