INTRODUCTION TO PROGRAMMING In the previous tutorial, had explained about the platforms and its look. I think that the previous tutorial has given a basic idea of the IDE of VB.NET. First of all, we should understand the view of the IDE of VB.NET and then only programming will be easier to do as we are going to program with POP method. In here, we are going to use the tools to do basic designs on a form or many forms as we needed. And then going to do coding as our requirements. In This Tutorial:
Introduction to use tools and form to a planned project The plan is to create a project for a two numbers calculation: So, we need the tools: a label and a command button: The requirement is when click on the "OK" command button I want to get the total value of 45 printed in the label like Total : 45 while calculating 20 and 25. Look at the design for it as follow: For the above design, you have to do some changes in the properties of all three objects (Form, Label, and Command button). In the properties of : 1) Label; Text : "Empty" (Just click text property and delete the text "label1") 2) Button; Text : "OK" (Just clear the button1 in the text property and type "OK") 3) Form; Name : "Calculate" (Just clear the Form1in the name property and type "Calculate") Look at the following screenshot for coding: When you want to code, you can use couple of methods to go to the code window, but for now just double click on the tool which is going to be used for an event/action (Events: click or mouse move or mouse over or dragdrop or any others) eventually happened on the tool. In the above screenshot, indicated by red colour brackets which means the line is disabled and the action isn't on the running program. Note: To disable a line of coding in the code window can be used a single quotation mark at start of the line. Once you done your coding and then you can go and click on the Run tool to go and execute the program. And if you haven't made any error on your coding program will run or will display the error with an error code and if there is/are errors on your coding would be able to see all of them in the "OUTPUT" window is below the programming area. You would be able to see the output of the running program as follow: In this window, after clicked on the "OK" button result also will be displayed on the Label. The result will display after the click (event/action) on the button because in order to the coding, instructed as program can work on button click.
OK!!! If you have any question on this introduction of programming, please state all your questions through "Comments" section.
0 Comments
|
Archives |