USING DIFFERENT TOOLS ON WINDOWS FORM: Usually, when users want to do something on the computer, they required some software to do their jobs. This means, software will help users to perform their work on any of their computer/related devices. And all the software have already been programmed to work with certain rules, for example, if a user wants to use MS-Excel to enter the data in it and do the jobs, the Excel will allow user to do limited works and the user can't do everything else as user want because Excel is designed only for those accounting purposes. Same thing here, if a programmer wants to create a program to do something, programmer can only create a program to do certain thing but depend on the requirements of the users need on the program as well. If a user wants to enter the data in an application and get the report briefly or fully, then programmer should create that project as requirement of the user/company. As a programmer, when you want to create a project using VB.NET, should be understood the facts in VB.NET and the project plan. When you clearly understood the project plan then you would be able to do design in the project yourself which tools are going to go where? and why? In This Tutorial:
About project and project plan: When design a project you should consider the following things as programmer: Designing: 1) Tools: Which and where you are going to use them and how? (Using form and drawing other tools on it) 2) Tool Property: What are the properties need to be changed (Property settings on all tools and forms) 3) Project and its sub settings Coding: When you got into the coding window should be considered on "Project_Name, Tool/Object, and Event" 1) Project: This is your project name 2) Tool/Object: Which is you are going to use to act for your coding 3) Event: Which is going to be your action on the tool (Example: Mouse_Click) What is a tool in VB.NET? The tools are in VB.NET to use them to design the view of the interface for the users, especially if there a need for a user to allow two numbers to be entered and then get the total of calculation in the view of windows form then programmers have to use the provided tools in the VB.NET to accomplish the need. Provided Basic Tools Categories in VB.NET as follow: 1) All windows Forms: In here: Button, Label, Check Box, Text Box, Combo Box, colorDialog and many more. 2) Common Controls, Menu & Tool bars, Containers, Data, Component, Printing, and Dialogs: In here: Whatever tools are provided in the All Windows Forms have been categorized by its acts. The following screenshot for the designed form of two numbers calculation: In order to the above design the explanation is below: The type of tool has been indicated with red colour text. When you want to change the property settings to any tool should be selected first. OK!!! The tool and its property settings need be done to bring the style and view on of tools like above: 1) Lable: Property settings
The following screenshot as an example of doing changes in the property settings and this is for changing the font setting as required view on the form.
2) Label: Property settings
3) Label: Property settings
4) Label: Property settings
5) TextBox: Property settings
6) TextBox: Property settings
7) Button: Property settings
Once you done all the property settings for all required tools, double click on the "OK" button to go to the coding window (While you are in the designing mode). And write the following codes as shown in the screenshot below: The above coding is as text below: Public Class Form1 Private Sub CMDOK_Click(sender As Object, e As EventArgs) Handles CMDOK.Click Dim first_num As Double Dim second_num As Double first_num = TXTFIRSTNUM.Text second_num = txtsecondnum.Text lblresult.Text = "" lblresult.Text = "The total is: " & first_num + second_num End Sub End Class Once you write down all the above codes in the coding window, you can run/start the program through tool or menu. When you run the program you would be able to see your designed windows and it'll allow you to enter the data. Once you enter the date in both textboxes, click "OK" button to see the result as below in the screenshot. OK! I hope that this tutorial explained as you needed to understand the program and on top of that if you have any questions regarding this programming, please state all your questions through "Comments" section below.
1 Comment
|
Archives |