Place to share anything

Free Software, Download, Tips and Tutorials, Cars, Notebook, Review

Introduction to VisualBasic Pogramming

Visual Basic is a programming language that is considered one of the easiest to learn for programmers. The language is the closest to natural human language, making the computer “speech” the easiest to get started in programming Microsoft web forms or desktop forms. There are only a few basics needed to get started on the software programming language.

The sample below will guide you to get started using Visual Basic. Lets learn together.

    Variables

Defining a variable is the first step for Visual Basic programming. In any programming language, defining variables gives the developer a method of saving calculation results and input from the user. Below is an example of how to define a string variable:
Dim strMyVariable as String
The “dim” statement is short for “dimension.” The term is used in defining any variable in the code file. Standards for development place defined variables at the top of the code file. The “String” term tells the compiler that the variable will be used to hold characters. The following code assigns a string value to the strMyVariable:
strMyVariable = “My First App.”
It’s important to assign the right type of entries to a variable. For instance, the code below would generate an error. The code tries to assign a number to a string variable.
strMyVariable = 0

Your First Program

(more…)

  • Share/Bookmark

Gambas tutorial, How to open image in Gambas

Hi, see you in this gambas tutorial. Now we will learn how to open or load image into PictureBox. As usual, the first thing you have to do is, create a new form, then add two controls (picturebox and button). Design your form to suit your needs. Now add these lines into your class.

PUBLIC SUB Button1_Click()
PictureBox1.Picture = Picture.Load(”your-image-path”)
END

Gambas uses Picture.Load (your image path as string) to load picture into PictureBox, instead of using FromFile (your image path as string) that is used in VisualBasic and SharpDevelop.
Now run your application. You should see your image shown in your PictureBox.

Incoming search terms for the article:

  • Share/Bookmark

Sharpdevelop tutorial Check if file exist

sharpdevelop
Hai, see you again in Sharpdevelop tutorial.

Now, we will learn how to check if file exist using sharpdevelop. Please note, that this tutorial shown here maybe applied to VisualBasic too.

SharpDevelop can do many things, almost same with Miscrosoft VisualBasic. But its free one. I will try to keep posting about Sharpdevelop, hope you enjoy my tutorials.

To check if a file is exist, we use System.IO.File.Exist. See the example below:
Sub BtncheckClick(sender As Object, e As EventArgs)
MsgBox(System.IO.File.Exists(”D:\test.txt”))
End Sub

Codes above will check if test.txt exist. If it not exist, then it will returned false.
sharpdevelop1

Incoming search terms for the article:

  • Share/Bookmark