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 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
You can employ For...Next statements to run a block of statements a specific number of times. For loops, employ a counter variable whose value is increased or decreased with each r

Default Values for GDI Objects: The default color for the brush is white, pen is black, and default bitmap is null and the default font is system.

Associating Toolbars for the menu: 1. Insert the tool bar control to your form. 2. Now follow the steps to append the tool bar control to your form. 3. Then, Right Click

Function IsPalindrome(str) Dim iStart,iEnd,ctr,blnPalin str=trim(str) blnPalin=true iEnd=len(str) iCnt=round(iEnd / 2) iStart=1 for ctr=1 to cint(iCnt) if(mid(str,iEnd,

Files in a SDI and MDI Application: Both the SDI and MDI projects have 4 implementation files (.cpp extension). These are the files equivalent to the Document Class, View Clas

Dialog Based Application: (A) Dialog Based Application to demonstrate Animate Control: 1. Build a dialog based application. 2. Design the dialog as shown. 3. Place

The Frame: As the name suggests, the frame is a combination of the building blocks, structure and the borders of an item. The frame gives the "physical" presence to a window.

Let us modify the webTime ASP.NET project that we developed. We will add drop down lists for modifying the different style elements for the label element that displays the time. We

I have a project due tomorrow that I am really struggling in. Please help.

Create a project that draw a rectangle shape which may be either (*) or (+) according to the selected radio button. The number of rows in the shape will be taken from the 1 st