In this code example you will learn how to clear text boxes in Visual Basic 2010 The following code is for Clear Text Button.click event: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim a As Control For Each a In Me.Controls If TypeOf a Is TextBox Then a.Text = Nothing …
How to create a class in Visual Basic 2010 – Classes
In this tutorial, we cover how to create a class, how to add members to a class and how to create an instance of a class. This is one of the core concepts of the language itself and it is vital that you understand it. A class is like a blank canvas or a template …
Write to a Text File on a Website – Visual Basic 2010
In this example you’ll learn how to write to a file on a website. Write to a text file on a website Dim clsRequest As System.Net.FtpWebRequest = _ DirectCast(System.Net.WebRequest.Create(“ftp://domain.com/www/file.txt”), System.Net.FtpWebRequest) clsRequest.Credentials = New System.Net.NetworkCredential(“username”, “password”) clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile ‘/ reading file… Dim bFile() As Byte = System.IO.File.ReadAllBytes(“C:\location\file.txt”) ‘/ upload file… Dim clsStream As System.IO.Stream = …
How to Send an Email Tutorial – Visual Basic 2010
In this tutorial we will learn a simple how to send email in visual basic 2010. This is a basic SMTP example of how to send mail using the System.Net class library. Add the Buttons and TextBoxes as seen in the image below: Then add the Following Code: Imports System.Net.Mail Public Class Form1 Private Sub Button1_Click(ByVal …
Simple Log In Application Tutorial – Visual Basic 2010
In this tutorial we will learn how to create a very simple log in application. First let’s start by adding the following items to your form application: 2 TextBoxes and 2 Buttons Now you can name them as listed below in the image: Now add …
Verify if Text Entered Into TextBox are Numbers – Visual Basic 2010
How to verify if text entered into the text box is numeric or if it is not then do something. You can use this code with either a Text Changed event or a final check method. Here is the code that verifies TextBox characters are Numbers: If Char.IsNumber(TextBox1.Text.Chars(TextBox1.TextLength – 1)) = True Then Else MsgBox(“Please …
Your First Visual Basic Application using Visual Express 2010
Welcome to your first visual basic tutorial, we are going to learn the very basics in this tutorial. I going to assume you already have Visual Basic 2010 Express installed on your PC. Visual Basic Express 2010 and any other versions of Visual Express are all free profucts from Micorsoft, you can download them for …