![]() MsgBox( "My First Visual Basic 2013 Program") Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load In order to make the load event does something, we shall insert the statement MsgBox( “Welcome to Visual Basic 2013”) Public Class Form1 Furthermore, the event procedure usually starts with the keywords Private Sub and ends with the keywords End Sub. It does nothing other than loading an empty form. ![]() As you can see, the control Form1 is associated with the Load event with an underscore, i.e. The procedure in this example is to load the default form Form1. Figure 4.1 illustrates the event procedure load associated with the default form.įigure 4.2 shows the events associated with the buttonĪfter opening up the code window, you can start writing the VB code. As you shall see, the VB code appears on the left side is the event procedure associated with the load event. In addition, you need to click on the default event to view other events associated with the control. The default event will appear at the top portion on the right side of the code window. In order to view the events, you need to double-click the control on the form to enter the code window. In addition, every control(object) you place on the form has a set of events related to them. Some of the events are load, click, double click, drag, and drop, pressing the keys and more. Visual Basic 2013 is an event-driven programming language, which means that the code is executed in response to events. ![]() Writing code in visual basic for excel 2013 how to#However, before learning how to write Visual Basic code, let me first explain the concept of event-driven programming 4.1 The Concept of Event-Driven Programming Therefore, we shall learn how to write code for all the controls so that they can interact with events triggered by the users. ![]() However, the controls will not function without adding code to them. In the preceding lesson, you have learned how to design the user interface by inserting controls to the form and changing their properties. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |