Docvb
Docvb
Design :-
Code :-
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Text = "Pascal's Triangle"
End Sub
lstPascalTriangle.Items.Clear()
For i As Integer = 0 To n - 1
Dim row As String = String.Join(" ", GetPascalRow(i))
lstPascalTriangle.Items.Add(row)
Next
End Sub
Return row
End Function
End Class
Output :-
23. Create an application to implement the working of context menu on
textbox.
Design :-
Code :-
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
txtInput.ContextMenuStrip = contextMenu
End Sub
Output :-
26. Write a Program to launch using PictureBox and Timer control.
Design :-
Code :-
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
picRocket.SizeMode = PictureBoxSizeMode.StretchImage
picRocket.Image =
vbproject.My.Resources.Resources.Screenshot_2025_01_03_171907
picRocket.Location = New Point((Me.ClientSize.Width - picRocket.Width)
\ 2, Me.ClientSize.Height - picRocket.Height)
tmrLaunch.Interval = 50
AddHandler tmrLaunch.Tick, AddressOf tmrLaunch_Tick
End Sub
tmrLaunch.Start()
btnLaunch.Enabled = False
End Sub
tmrLaunch.Stop()
MessageBox.Show("Rocket Launched!", "Success",
MessageBoxButtons.OK, MessageBoxIcon.Information)
btnLaunch.Enabled = True
End If
End Sub
End Class
Output :-
42. Develop an application which is similar to login form.
Design :-
Code :-
Public Class Form2
Me.Close()
End Sub
Output :-
44. Develop a project which displays the student information in the relevent
fields from the database which already exists.
Design :-
Code :-
Imports System.Data.OleDb
Output :-
DataBase :-
56. Create a table for employee and write a program using Dataset to add,
delete, edit and navigate record.
Design :-
Code :-
Imports System.Data.OleDb
dataset.Tables("Employee").Rows.Add(newRow)
adapter.Update(dataset, "Employee")
MessageBox.Show("Record added successfully.")
Catch ex As Exception
MessageBox.Show("Error adding record: " & ex.Message)
End Try
End Sub
adapter.Update(dataset, "Employee")
MessageBox.Show("Record updated successfully.")
End If
Catch ex As Exception
MessageBox.Show("Error updating record: " & ex.Message)
End Try
End Sub
Delete :-
DataBase :-
57. Write a program to access a database using ADO.net and display a key
column in the combo box or list box when an item is selected in it, its
corresponding records is shown in Datagridconrol.
Design :-
Code :-
Imports System.Data.OleDb
LoadEmployeeIDs()
End Sub
cmbEmployeeID.DisplayMember = "EmployeeID"
cmbEmployeeID.ValueMember = "EmployeeID"
cmbEmployeeID.DataSource = dataTable
Catch ex As Exception
MessageBox.Show("Error loading Employee IDs: " & ex.Message)
End Try
End Sub
adapter.Fill(dataset, "EmployeeDetails")
dgvEmployeeDetails.DataSource = dataset.Tables("EmployeeDetails")
Catch ex As Exception
MessageBox.Show("Error loading employee details: " & ex.Message)
End Try
End Sub
End Class
Output :-
DataBase :-