Programming in VB.NET

All you need to start programming in VB.NET

Microsoft Visual Studio

Visual Studio IDE, Code Editor, VSTS, & App Center

You can download a trial version or professional version. This program is mostly for Microsoft Windows programming. However, new versions are arising for Linux and Mac operating systems.

Microsoft Visual Studio 2017 allows one to program in :

  • VB.Net
  • C#
  • F#
  • Python
  • JavaScript
  • PHP
  • and much more

Notepad ++

https://notepad-plus-plus.org/

You can also use the Notepad ++ to read most of files type.

DevComponents

http://devcomponents.com/

DevComponents provides a set of tools for Visual Studio to help developers with design and utilities.

Look up for their DotNetBar product.

If you are starting to program, you must understand certain principles in VB.NET.


[Project]

The above image represent the general schema of a project.

In your project you can create objects to enable human interactions or manage data. The most used objects are called Class, they can have a visual component called a FORM CLASS or can store functions, properties and variables. Also, you have the Modules objects that are mostly used to store functions.

Perhaps the most important concept to remind is that a Class is like a tangible tool that you can dispose of (that you can stop) but the module is more like asking direct questions.


[Modules]

Attributes : Can be Private (Only usable in the project), Public, Friend
Can Host: Classes


Can be Private (Only usable in the project), Public (Can be called generally), Friend (Can be called in the project)

A Module is a set of functions that can be called upon in your project.


[Classes]

Attributes : Can be Private (Only usable in the project), Public, Friend
Can Host: Classes
Optional: Can display a Form, Can be called multiples of times


Can be Private (Only usable in the project), Public (Can be called generally), Friend (Can be called in the project)

Representations


[Enumeration]

Represent a range of predefined options.

[Structures]

Store virtual schema of information.

1) Create a new Project:
2) Create a new Form Class “Form1”
3) Add the following objects:

4) In the code view copy this code or download it App1.

Public Class Form1
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
Dim OFD As New OpenFileDialog
OFD.Filter = “Jpeg(*.jpg)|*.jpg”
If OFD.ShowDialog = DialogResult.OK Then
PictureBox1.ImageLocation = OFD.FileName
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
End If
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.Items.Add(“Single”)
ComboBox1.Items.Add(“Married”)
ComboBox1.Items.Add(“Seperated”)
ComboBox1.SelectedIndex = 0
End Sub

Public Enum E_Status
Singles
Married
Separated
End Enum

Public Singles As String = “Single”
Public Married As String = “Married”
Public Separated As String = “Separated”

Public Structure Person

Public Name As String
Public Age As Integer
Public HasChildren As Boolean
Public Photo As Image
Public MaritalStat As E_Status

End Structure

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim NewPerson As New Person
NewPerson.Age = NumericUpDown1.Value
NewPerson.Name = TextBox1.Text
NewPerson.HasChildren = If(CheckBox1.Checked = True, True, False)
NewPerson.Photo = PictureBox1.Image
If ComboBox1.SelectedIndex = 0 Then
NewPerson.MaritalStat = E_Status.Singles
ElseIf ComboBox1.SelectedIndex = 1 Then
NewPerson.MaritalStat = E_Status.Married
ElseIf ComboBox1.SelectedIndex = 2 Then
NewPerson.MaritalStat = E_Status.Separated
End If
MsgBox(“New Person : “ & vbNewLine &
“Name : “ & NewPerson.Name & vbNewLine &
“Age : “ & NewPerson.Age & vbNewLine &
“HasChildren “ & If(NewPerson.HasChildren = True, “Yes”, “No”) & vbNewLine &
“Photo : “ & NewPerson.Photo.ToString & vbNewLine &
“MaritalStat : “ & NewPerson.MaritalStat.ToString)
End Sub

End Class

I am tab content. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
I am tab content. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

My Programs

9575total visits,1visits today

Share with:
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Telephone

+41 (079) 5111570

Postal address

Saadry Dunkel
2 avenue des Amazones
1224 ChĂȘnes-Bougeries

Contact Us




All fields are required.


Sending...

Close contact form
UA-29636309-1