Visual Basic Projects With Source Code -

Visual Basic (VB.NET) often gets a bad rap as a "beginner's toy," but don't let the critics fool you. In the enterprise world, VB.NET is a fully supported, object-oriented language that runs on the powerful .NET framework. It is incredibly efficient for building Windows desktop applications (WinForms), automating Excel, and even creating web apps.

Public Class Calculator Dim currentInput As String = "" Dim firstNumber As Double = 0 Dim operation As String = "" Private Sub Number_Click(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click, '... etc Dim btn As Button = CType(sender, Button) currentInput &= btn.Text txtDisplay.Text = currentInput End Sub visual basic projects with source code

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load conn = New SQLiteConnection(connectionString) conn.Open() ' Create table if not exists Dim cmd As New SQLiteCommand("CREATE TABLE IF NOT EXISTS Students (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT, Grade INTEGER)", conn) cmd.ExecuteNonQuery() LoadData() End Sub Visual Basic (VB

Private Sub SaveTasks() Using writer As New StreamWriter(tasksFile) For Each task In lstTasks.Items writer.WriteLine(task.ToString()) Next End Using End Sub Public Class Calculator Dim currentInput As String =

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' Load tasks from file on startup If File.Exists(tasksFile) Then Dim lines() As String = File.ReadAllLines(tasksFile) For Each line In lines lstTasks.Items.Add(line) Next End If End Sub

Select Case operation Case "+" : result = firstNumber + secondNumber Case "-" : result = firstNumber - secondNumber Case "*" : result = firstNumber * secondNumber Case "/" : result = firstNumber / secondNumber End Select