Free Source Codes
This site is free of programming source codes. All you have to do is read, follow instructions and download the file.
Linggo, Marso 23, 2014
Deeper Understanding to VB.NET Class
Classes are essential to VB.NET programs. They are the building blocks of our programs. A Class is a reference type—it is allocated on the managed heap. It can have Functions and Subs, and also data members—this includes fields. It is a container for data and code. The data within the class can be accessed with properties. The code is referred to as methods.
The best thing about OOP is that it allows you to group data into discrete variables contained within a class in your program. This data is separate and distinct from any other class in your application. No class can interfere with the data in any other class without going through a specific interface on that class.
Each object defines its functionality as a set of properties and methods that it will respond to. Other code can call these methods on the object and have them perform some behavior and use the properties to retrieve or change some information. In this way, code cannot affect the information or processes of other objects directly. As you build a class, you will see how to build this functionality using properties and methods.
This is my sample laboratory activity program for my students enrolled in VB.net course.
Biyernes, Marso 14, 2014
Application Launcher using VB.NET
This is a tutorial in which we will going to have a program that can launch any applications, program, and websites.
Now, let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to <b>File</b>, click <b>New Project</b>, and choose <b>Windows Application.</b>
2. Next, add only one Button named Button1 and labeled it as "Run" and one textBox named TextBox1 that will serve as our input. You must design your interface like this:
3. Now put this code for your code module. This code is for Button1_Click:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
On Error Resume Next
Process.Start(TextBox1.Text)
End Sub
<b>Explanation:</b>
We first code for an <b>On Error Resume Next</b> which specifies that when a run-time error occurs, control goes to the statement immediately following the statement where the error occurred, and execution continues from that point. Then we have the Process.Start method to start the method inputted in TextBox1. This starts a process resource by specifying the name of a document or application file and associates the resource with a new Process component.
<b>Output:</b>
Now, let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to <b>File</b>, click <b>New Project</b>, and choose <b>Windows Application.</b>
2. Next, add only one Button named Button1 and labeled it as "Run" and one textBox named TextBox1 that will serve as our input. You must design your interface like this:
3. Now put this code for your code module. This code is for Button1_Click:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
On Error Resume Next
Process.Start(TextBox1.Text)
End Sub
<b>Explanation:</b>
We first code for an <b>On Error Resume Next</b> which specifies that when a run-time error occurs, control goes to the statement immediately following the statement where the error occurred, and execution continues from that point. Then we have the Process.Start method to start the method inputted in TextBox1. This starts a process resource by specifying the name of a document or application file and associates the resource with a new Process component.
<b>Output:</b>
Mag-subscribe sa:
Mga Post (Atom)