0% found this document useful (0 votes)
34 views94 pages

GUI Application Development Using VB .Net (22034)

Uploaded by

inamdarparvej19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views94 pages

GUI Application Development Using VB .Net (22034)

Uploaded by

inamdarparvej19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Practical No. 3: Implement a Message Box program & Arithmetic Expressions.

Practical No: 03

VIII. Resources required (Additional)


- If any web reference is required.

X. Resources required (Actual)


(1) [Link]
/operators-and-expressions/arithmetic-operators
(2) [Link]
netframework-4.7.2

XI. Program Code:


Write a program using MessageBox and Arithmetic Expressions –

Module Module1
Dim i, j, r As Integer

Sub Main()
[Link]("Enter First Value=")
i = [Link]()
[Link]("Enter Second
Value=") j = [Link]()
[Link]()
MsgBox("Addition =" & (i + j))
MsgBox("Substraction =" & (i - j))
MsgBox("Multiplication =" & (i * j))
MsgBox("Division =" & (i / j))
End Sub
End Module
Results (Output of the Program)
Enter First Value=
10
Enter Second Value=
5
---------------------------
MessageBoxPractical3
---------------------------
Addition =15
---------------------------
OK
---------------------------

GUI Application Development using [Link] (22034) Page 1


Practical No. 3: Implement a Message Box program & Arithmetic Expressions.

XIII. Practical Related Questions


1. Write the difference between MessageBox() and ErrorProvider Control –
- Displays a message window, also known as a dialog box, which presents a message to the
user. It is a modal window, blocking other actions in the application until the user closes it.
A MessageBox can contain text, buttons, and symbols that inform and instruct the user.
- Sets the error description string for the specified control. When an error occurs for the value
in associated control, then a small red color icon is displayed and when we hover the mouse
on icon it displays an error message.

2. Describe any four types of MessageBox() Window –


In Visual Basic, MessageBox has Show() method and it is overloaded to create various
types of MessgeBoxes and various programming situations –

It has prototype –
DialogResult Show(String text, String caption, MessageBoxButtons buttons,
MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
This method is static and doesn’t required and object reference. The parameters and return
values are explained below –

Parameters
1. text As String - The text to display in the message box.
2. caption As String - The text to display in the title bar of the message box.
3. buttons As MessageBoxButtons - One of the MessageBoxButtons values that
specifies which buttons to display in the message box.
4. icon As MessageBoxIcon - One of the MessageBoxIcon values that specifies which
icon to display in the message box.
5. defaultButton As MessageBoxDefaultButton - One of the
MessageBoxDefaultButton values that specifies the default button for the message
box.

Returns
DialogResult - One of the DialogResult values.

GUI Application Development using [Link] (22034) Page 2


Practical No. 3: Implement a Message Box program & Arithmetic Expressions.

XIV. Exercise
1. Implement the program to generate result of any arithmetic operation using
MessageBox().

Public Class Form1


Dim n As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
n = Val([Link]) + Val([Link])
MsgBox("Addition=" & n)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]
n = Val([Link]) - Val([Link])
MsgBox("Substraction=" & n)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles [Link]
n = Val([Link]) * Val([Link])
MsgBox("Multiplication=" & n)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles [Link]
n = Val([Link]) / Val([Link])
MsgBox("Division=" & n)
End Sub
End Class

-Arithmetic Operation using msgbox

Addition=60

GUI Application Development using [Link] (22034) Page 3


Practical No. 3: Implement a Message Box program & Arithmetic Expressions.
OK

GUI Application Development using [Link] (22034) Page 4


Practical No. 3: Implement a Message Box program & Arithmetic Expressions.

2. Write a program using InputBox(), MessageBox() & perform various Arithmetic


expressions.

Public Class Form1


Dim i, j, r As Integer

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


i = InputBox("Enter First Value")
j = InputBox("Enter Second Value")
r = Val(i) - Val(j)
MsgBox("Substract = " & r)
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles [Link]


i = InputBox("Enter First Value")
j = InputBox("Enter Second Value")
r = Val(i) / Val(j)
MsgBox("Divide = " & r)
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles [Link]


i = InputBox("Enter First Value")
j = InputBox("Enter Second Value")
r = Val(i) * Val(j)
MsgBox("Multiply = " & r)
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


i = InputBox("Enter First Value")
j = InputBox("Enter Second Value")
r = Val(i) + Val(j)
MsgBox("Addition = " & r)

End Sub
End Class

GUI Application Development using [Link] (22034) Page 5


Practical No. 3: Implement a Message Box program & Arithmetic Expressions.

Output:

Inputbox_Msgbox

Addition = 68

OK

GUI Application Development using [Link] (22034) Page 6


Practical No. 4: Implement a program for If-else control structures in [Link].

Practical No: 04

VIII. Resources required (Additional)


- If any web reference is required.

X. Resources required (Actual)


(1) [Link]
else-statement
(2) [Link]

XI. Program Code:


Write a program using if-else statement –
 Module Module1
Sub Main()
Dim n As Integer
[Link]("Enter a Number")
n = [Link]()
If (n > 0) Then
[Link]("Number is Positive")
Else
[Link]("Number is Negative")
End If
[Link]()
End Sub
End Module

Results (Output of the Program)


Enter a number:
9
Number is Positive

XIII. Practical Related Questions


1. Write program for finding greatest among three numbers –
 Module Module1
Sub Main()
Dim a, b, c As Integer
[Link]("Enter the values of a, b and c:")
a = Val([Link]())
b = Val([Link]())
c = Val([Link]())
If (a > b) Then
If (a > c) Then
[Link]("Greatest Number is:" & a)
Else
[Link]("Greatest Number is:" & c)

End If
Else
If (b > c) Then

GUI Application Development using [Link] (22034) Page 1


Practical No. 4: Implement a program for If-else control structures in [Link].

[Link]("Greatest Number is:" & b)


Else
[Link]("Greatest Number is:" & c)
End If
End If
[Link]()
End Sub
End Module
Results (Output of the Program)
Enter the values of a, b and c:23
65
12
Greatest Number is:65

2. Implement the program using if-else statement to find the number is even or odd –
 Module Module1
Dim i As Integer

Sub Main()
[Link]("Enter Number")
i = [Link]()
If ((i Mod 2) = 0) Then
[Link]("Number is Even")
Else
[Link]("Number is Odd")
End If
[Link]()
End Sub
End Module

Results (Output of the Program)


Enter a number:
9
Number is Odd

XIV. Exercise
1. Write the program using if-else statement for following output.
Result Percentage Criteria
Fail perc < 40
Second Class perc > 40 AND perc < 60
First Class perc > 60 AND perc < 75
Distinction perc > 75

 Module Module1

Sub Main()
Dim perc As Integer
[Link]("Enter Percentage:")
perc = Val([Link]())

GUI Application Development using [Link] (22034) Page 2


Practical No. 4: Implement a program for If-else control structures in [Link].

If (perc < 40) Then


[Link]("Fail")
ElseIf ((perc > 40) And (perc < 60)) Then
[Link]("Pass Class")
ElseIf ((perc >= 60) And (perc < 75)) Then
[Link]("First Class")
ElseIf (perc >= 75) Then
[Link]("Distinction")
End If
[Link]()
End Sub

End Module

Results (Output of the


Program) Enter
Percentage:85 Distinction

2. Write output of following code.


 Module Module1

Sub Main()
Dim i As Integer
i=4
Dim a As Double
a = -1.0

If (i > 0) Then
If (a > 0) Then
[Link]("Here I am !!!!")
Else
[Link]("No here I am ??")
[Link]("Actually here I am ??")
End If
End If

[Link]()
End Sub

End Module

Results (Output of the Program)


No here I am ??
Actually here I am ??

GUI Application Development using [Link] (22034) Page 3


Practical No. 5: Implement a program for Select case control structures in [Link].

Practical No: 05

VIII. Resources required (Additional)


- if any web references are required.

X. Resources used (Additional)


(1) [Link]
case-statement
(2) [Link]

XI. Program Code:


Write a Program using select case statement in [Link]

Module Module1

Sub Main()
Dim grade As String
[Link]("Enter Your grade")
grade = [Link]()
Select Case grade
Case "A"
[Link]("High Distinction")
Case "A-"
[Link]("Distinction")
Case "B"
[Link]("Credit")
Case "C"
[Link]("Pass")
Case Else
[Link]("Fail")
End Select
[Link]()
End Sub

End Module
XII. Results (Output of the Program)
Enter Your grade
A
High Distinction
XIII. Practical Related Questions
1. Write the use of Select Case statement –
- A Select Case statement allows a variable to be tested for equality against a list
of values.
- Each value is called a case, and the variable being switched on is checked for
each select case.

GUI Application Development using [Link] (22034) Page 1


Practical No. 5: Implement a program for Select case control structures in [Link].

2. Flowchart for nested Select Case statement –

XIV. Exercise

1. Implement the program using Select Case statement to count the number of Vowels
in A to Z alphabets.
 Module Module1
Sub Main()
Dim str As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Dim numberOfVowels As Integer = 0

For Each c As Char In str


Select Case c
Case "A"c, "E"c, "I"c, "O"c, "U"c
numberOfVowels = numberOfVowels + 1
End Select
Next

[Link]("Number of vowels: " & numberOfVowels)


[Link]()
End Sub
End Module
Output:
Number of vowels: 5

GUI Application Development using [Link] (22034) Page 2


Practical No. 5: Implement a program for Select case control structures in [Link].

2. Develop a program for performing arithmetic operations –


Module Module1
Sub Main()
Dim N1, N2, Result, choice As Integer
Do
[Link]("Menu:-\[Link]\[Link]" & _
"\[Link]\[Link]\[Link].")
[Link]("Enter choice: ")
choice = [Link]()
[Link]("Enter number 1: ")
N1 = [Link]()
[Link]("Enter number 2: ")
N2 = [Link]()
Select Case choice
Case 1
Result = N1 + N2
[Link]("Sum = " & Result)
Case 2
Result = N1 - N2
[Link]("Difference = " & Result)
Case 3
Result = N1 * N2
[Link]("Product = " & Result)
Case 4
Result = N1 \ N2
[Link]("Quotient = " & Result)
Result = N1 Mod N2
[Link]("Remainder = " & Result)
Case 5
Exit Sub
Case Else
[Link]("Wrong option ...")
End Select
Loop While choice <> 5
End Sub
End Module
Output:
Menu:-\[Link]\[Link]\[Link]\[Link]\[Link].
Enter choice: 1
Enter number 1: 57
Enter number 2: 87
Sum = 144
Menu:-\[Link]\[Link]\[Link]\[Link]\[Link].
Enter choice: 5

GUI Application Development using [Link] (22034) Page 3


Practical No. 6: Implement a program for While, Do Loops in [Link].

Practical No 06

VIII. Resources required (Additional)


- If any web references are required.

X. Resources used (Additional)


- [Link]
end-while-statement
- [Link]
loop-statement

XI. Program Code


Write a program using While & Do loop in [Link]
 For while loop.
Module Module1

Sub Main()
Dim a As Integer =
1 While (a < 10)
[Link](
a) a = a + 1
End While
[Link]()
End Sub

End Module
Output:
1
2
3
4
5
6
7
8
9
 For Do loop.
Module Module1

Sub Main()
Dim a As Integer =
1 Do
[Link](
a) a = a + 1
Loop While (a<10)
[Link]()
End Sub

End Module

GUI Application Development using [Link] (22034) Page 1


Practical No. 6: Implement a program for While, Do Loops in [Link].

Output:
1
2
3
4
5
6
7
8
9

XIII. Practical Related Questions


1. Differentiate between Do & While Loop statements in [Link]
No Do Loop No While Loop
In Do loop, the condition can be tested
In While loop, the condition can be
1 at starting or ending as per 1
tested at starting only.
requirement.
For Do Loop two variation available For While loop no such variations are
2 2
Do While Loop & Do Until Loop available.
Do While Loop statement can execute
for finite number of iterations as long
While loop can execute for finite
as condition of loop is true while Do
3 3 number of iterations as long as
Until Loop statement can execute for
condition of loop is true.
finite number of iterations as long as
condition of loop is false.
Loop keyword is used as termination End keyword is used as termination
4 4
statement for Do loops. statement for While loop.
Dim index As Integer = 0 Dim index As Integer = 0
Do While index <= 10
[Link](index & " ") [Link](index & " ")
index += 1 index += 1
5 5
Loop Until index > 10 End While

[Link]("") [Link]("")
' Output: 0 1 2 3 4 5 6 7 8 9 10 ' Output: 0 1 2 3 4 5 6 7 8 9 10

2. Give the syntax of While & Do loop statements in [Link].


 While Loop:
It executes a series of statements as long as a given condition is True.
Syntax:
While condition
[ statements ]
[ Continue While ]
[ statements ]
[ Exit While ]
[ statements ]
End While

GUI Application Development using [Link] (22034) Page 2


Practical No. 6: Implement a program for While, Do Loops in [Link].

Do Loop:
It repeats the enclosed block of statements while a Boolean condition is True or until the
condition becomes True. It could be terminated at any time with the Exit Do statement.
Syntax:
Do
[ statements ]
[ Continue Do ]
[ statements ]
[ Exit Do ]
[ statements ]
Loop { While | Until } condition

XIV. Exercise
1. Write a program using While statement to print the prime numbers between 1 to 100.
Module Module1
Sub Main()
Dim i, j, c As Integer
c=0
i=2
While (i <= 100)
j=2
While (j < i)
If (i Mod j = 0) Then
Exit While
ElseIf (i = j + 1) Then
[Link](i)
End If
j=j+1
End While
i=i+1
End While
[Link]()
End Sub
End Module

OUTPUT:

GUI Application Development using [Link] (22034) Page 3


Practical No. 6: Implement a program for While, Do Loops in [Link].

2. Write a program using While statement to print even-odd numbers between 1 to 50.
 Module Module1

Sub Main()
Dim i As Integer = 1
While (i <= 50)
If ((i Mod 2) = 0) Then
[Link](i & " Even")
Else
[Link](i & " Odd")
End If
i=i+1
End While
[Link]()
End Sub

End Module
Output:

GUI Application Development using [Link] (22034) Page 4


Practical No. 7: Implement a program to demonstrate the use of For, For-each Loops in
[Link].

Practical No 07

VIII. Resources required (Additional)


- If any web references are required.

X. Resources used (Additional)


- [Link]
next-statement
- [Link]
each-next-statement

XI. Program Code


Write a program using For & For Each loop in [Link]
Program – Program to calculate search the element in an array using linear search.

Module Module1

Sub Main()
Dim Array() As Integer = {12, 34, 56, 37, 78, 53, _
98, 22, 19, 68}
Dim Key As Integer
Dim IsKeyFoundFlag As Boolean = False

[Link]("Enter element to search: ")


Key = [Link]()

For i As Integer = 1 To [Link]() - 1


If Array(i) = Key Then
IsKeyFoundFlag = True
End If
Next

If IsKeyFoundFlag = True Then


[Link]("Element present.")
Else
[Link]("Element absent.")
End If

[Link]()
End Sub

End Module

XII. Results (output of the program)


Enter element to search:
53
Element present

GUI Application Development using [Link] (22034) Page 1


Practical No. 7: Implement a program to demonstrate the use of For, For-each Loops in
[Link].

XIII. Practical Related Questions


1. Write the output of the following code?
Module Module1

Sub Main()
For i As Integer = 0 To -10 Step -1
[Link](i)
Next
[Link]()
End Sub

End Module

Output :
0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10

2. Write the program to generate the following output –


Module Module1

Sub Main()
Dim i As Single

For i = 3.5F To 8.5F Step 0.5F


[Link](i)
Next
[Link]()
End Sub

End Module

XIV. Exercise
1. Write the situation where for each loop statements can be implemented.
 Use a For Each...Next loop when you want to repeat a set of statements for each element
of a collection or array.

GUI Application Development using [Link] (22034) Page 2


Practical No. 7: Implement a program to demonstrate the use of For, For-each Loops in
[Link].

2. Write program using For Next loop statement tot find the Armstrong
numbers between 1 to 500. (153 is Armstrong Number – 13 + 53 + 33 = 153)
 Module Module1

Sub Main()
Dim i As Integer

[Link]("Armstrong Numbers between 1 to 500: ")


For i = 1 To 500 Step 1
Dim sum, num, digit As Integer
sum = 0
num = i

While (num > 0)


digit = num Mod 10
sum += (digit * digit * digit)
num = num \ 10
End While

If (sum = i) Then
[Link](i)
End If
Next
[Link]()
End Sub

End Module
Output:
1
153
370
371
407

GUI Application Development using [Link] (22034) Page 3


Practical No. 8: Design windows application using Text Box, Label & Button

Practical No 08
VIII. Resources required (Additional)
 If any web resources required.

X. Resources used (Additional)


 [Link]
us/dotnet/api/[Link]?view=netframework-4.7.2
 [Link]
us/dotnet/api/[Link]?view=netframework-4.7.2
 [Link]
us/dotnet/api/[Link]?view=netframework-4.7.2

XI. Program Code


Write a program to demonstrate the use of Button, Textbox and Label.

Public Class Form1


Private Function Factorial(ByVal num As Integer) As Long
Dim fact As Long = 1
Dim i As Integer

For i = 1 To num
fact *= i
Next
Factorial = fact
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
Dim fact As Long
fact = Factorial([Link])
[Link]("Factorial of " & [Link] &
" is " & fact, "Factorial", [Link],
[Link])
End Sub
End Class

GUI Application Development using [Link] (22034) Page 1


Practical No. 8: Design windows application using Text Box, Label & Button

XII. Results (output of the program)

XIII. Practical related Questions


1. Write the use of Tab Index property of the control.
 The following example uses the TabIndex property to display and set the tab order for
individual controls. The user can press Tab to reach the next control in the tab order and to
display the TabIndex of that control.

2. Write the code to generate button at runtime in [Link].


 Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]
Dim b As New Button
[Link] = "Click"
[Link](b)
End Sub
End Class
Output:

GUI Application Development using [Link] (22034) Page 2


Practical No. 8: Design windows application using Text Box, Label & Button

XIV. Exercise
1. Write a program to perform the arithmetic operations using controls Label, Button
and TextBox.

Public Class Form1


Dim n As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
n = Val([Link]) + Val([Link])
[Link] = n
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


n = Val([Link]) - Val([Link])
[Link] = n
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles [Link]


n = Val([Link]) * Val([Link])
[Link] = n
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles [Link]


n = Val([Link]) / Val([Link])
[Link] = n
End Sub
End Class
Output:

GUI Application Development using [Link] (22034) Page 3


Practical No. 8: Design windows application using Text Box, Label & Button

2. Write a program to change the background color of the form when user clicks
on different buttons.

Public Class Form1


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
[Link] = [Link]
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


[Link] = [Link]
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles [Link]


[Link] = [Link]
End Sub
End Class

Output:

GUI Application Development using [Link] (22034) Page 4


Practical No. 9: Design windows application using Radio Button & Check Box.

Practical No 09

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 [Link]
us/dotnet/api/[Link]?view=netframework-4.7.2
 [Link]
us/dotnet/api/[Link]?view=netframework-4.7.2

XI. Program Code


Write a program to demonstrate the use of CheckBox and RadioButton.
 Code to check Radio Buttons State

Public Class Form1


Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles
[Link]
If ([Link] = True) Then
[Link]("You are Select [Link]")
End
If End
Sub
Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles
[Link]
If ([Link] = True) Then
[Link]("You are Select JAVA")
End
If End
Sub
End Class
OUTPUT :

GUI Application Development using [Link] (22034) Page 1


Practical No. 9: Design windows application using Radio Button & Check Box.

Code to display message when the checkbox is checked -

Public Class Form1


Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles
[Link]
[Link]("you are select [Link]")
End Sub

Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles


[Link]
[Link]("you are select JAVA")
End Sub
End Class
OUTPUT :

GUI Application Development using [Link] (22034) Page 2


Practical No. 9: Design windows application using Radio Button & Check Box.

XIII. Practical related Questions


1. Write the program using RadioButton to change the bulb state ON/OFF.

Public Class Form1


Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles
[Link]
[Link]()
[Link]()
End Sub

Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles


[Link]

[Link]()
[Link]()
End Sub
End Class
OUTPUT:

GUI Application Development using [Link] (22034) Page 3


Practical No. 9: Design windows application using Radio Button & Check Box.

2. Differentiate between RadioButton and CheckBox controls.


- In a checkbox group, a user can select more than one option. Each checkbox operates
individually, so a user can toggle each response "Checked" and "Not Checked."
- Radio buttons, however, operate as a group and provide mutually exclusive selection
values. A user can select only one option in a radio button group.

XIV. Exercise
1. Write a program to change the ForeColor of the text in Label using
different RadioButtons such Red, Green, Blue.

Public Class Form1


Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles
[Link]
[Link] = [Link]
End Sub

Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles


[Link]
[Link] =
[Link] End Sub

Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles


[Link]
[Link] = [Link]
End Sub
End Class

GUI Application Development using [Link] (22034) Page 4


Practical No. 10: Design windows application using List Box & Combo Box.

Practical No 10

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 [Link]
us/dotnet/api/[Link]?view=netframework-4.7.2
 [Link]
us/dotnet/api/[Link]?view=netframework-4.7.2

XI. Program Code


1. Write a program to demonstrate the use of ListBox and ComboBox.
(Code for Add Items to ListBox & Remove Selected Item from ListBox)

Public Class Form1


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
[Link]([Link])
[Link] = ""
[Link]()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]([Link])
End Sub
End Class
XII. Results (output of the program):

GUI Application Development using [Link] (22034) Page 1


Practical No. 10: Design windows application using List Box & Combo Box.

XIII. Practical related Questions


1. Write the program to select multiple subjects using ListBox control.

Public Class Form1


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
[Link] [Link] = [Link]
[Link]("C")
[Link]("C++")
[Link]("JAVA")
[Link](".NET")
[Link]("PHP")
[Link]("Python")
End Sub
End Class
OUTPUT:

2. Write the program to select colleges using single ComboBox.


GUI Application Development using [Link] (22034) Page 2


Practical No. 10: Design windows application using List Box & Combo Box.

Public Class Combo_Box


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]
[Link]("MET")
[Link]("GGSP")
[Link]("KKW")
[Link]("GP")
End Sub

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs)


Handles [Link]
MsgBox([Link])
End Sub
End Class
OUTPUT:

XIV. Exercise

1. Differentiate between ListBox and ComboBox.


 The ComboBox allows to select single items from the Collection of Items. The ListBox
allows to select the single of multiple items from the Collection of Items using SelectMode
property.

2. Write a program to select multiple subjects for single semester.


GUI Application Development using [Link] (22034) Page 3


Practical No. 10: Design windows application using List Box & Combo Box.

Public Class Student_Registration


Private Sub Student_Registration_Load(sender As Object, e As EventArgs) Handles
[Link]
[Link]("First Semester")
[Link]("Second Semester")
[Link]("Third Semester")
[Link]("Fourth Semester")
End Sub

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs)


Handles [Link]
If ([Link] = 0) Then
[Link]()
[Link]("Chemistry")
[Link]("Physics")
[Link]("Maths")
[Link]("English")
End If
If ([Link] = 1) Then
[Link]()
[Link]("PIC")
[Link]("Maths")
[Link]("CHM")
[Link]("WPD")
End If
If ([Link] = 2) Then
[Link]()
[Link]("DBM")
[Link]("OOP")
[Link]("CGR")
[Link]("DSU")
End If
If ([Link] = 3) Then
[Link]()
[Link]("JPR")
[Link]("DCC")
[Link]("GUI")
[Link]("SEN")
End
If End
Sub
End Class
OUTPUT:

GUI Application Development using [Link] (22034) Page 4


Practical No. 11: Design windows application using Picture Box & Panel.

Practical No 11

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 [Link]
 [Link]
 [Link]

XI. Program Code


1. Write a program using Toolbar, Form and Panel Controls.

Public Class Form1


Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles
[Link]
[Link] = [Link]
End Sub

Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles


[Link]
[Link] = [Link]
End Sub
End Class

GUI Application Development using [Link] (22034) Page 1


Practical No. 11: Design windows application using Picture Box & Panel.

XII. Results (output of the program)

XIII. Practical related Questions


1. List the controls which is used to set the icons on the Toolbar Control.
 Following Controls Can be added to ToolStrip / Toolbar.
Button, Label, DropDownButton, SplitButton, Separator, ComboBox, TextBox, and
ProgressBar.
2. Difference between Form and Panel.
Windows Forms Panel controls are used to provide an identifiable grouping for other
controls. Typically, you use panels to subdivide a form by function. The Panel control is
similar to the GroupBox control; however, only the Panel control can have scroll bars, and
only the GroupBox control displays a caption.

XIV. Exercise
1. Write program using picture box control to load an image at run time.

Public Class Form1


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]
[Link] = "E:\[Link]\ON_Bulb.jpg"
[Link] = [Link]
End Sub

GUI Application Development using [Link] (22034) Page 2


Practical No. 11: Design windows application using Picture Box & Panel.
End Class

GUI Application Development using [Link] (22034) Page 3


Practical No. 11: Design windows application using Picture Box & Panel.

OUTPUT:

2. Write a program to demonstrate the use of Panel Control in [Link].

Public Class Form1


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
Dim dynamicPanel As New Panel()
[Link] = "Panel1"
[Link] = New [Link](228, 200)
[Link] = [Link]

Dim textBox1 As New TextBox()


[Link] = New Point(10, 10)
[Link] = "Enter Your Name"

Dim checkBox1 As New CheckBox()


[Link] = New Point(10, 50)
[Link] = "Male"
[Link] = New Size(200, 30)

Dim checkBox2 As New CheckBox()


[Link] = New Point(10, 90)
[Link] = "Male"
[Link] = New Size(200, 30)

[Link](textBox1)

GUI Application Development using [Link] (22034) Page 4


Practical No. 11: Design windows application using Picture Box & Panel.

[Link](checkBox1)
[Link](checkBox2)

[Link](dynamicPanel)
End Sub
End Class
OUTPUT:

GUI Application Development using [Link] (22034) Page 5


Practical No. 12: Design windows application using Tab Control & Timer.

Practical No 12
VIII. Resources required (Additional)
 If any web resources required.

X. Resources used (Additional)


 [Link]
 [Link]

XI. Program Code


1. Write a program using Tab Control.

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


[Link] = "Button from FY has been Clicked!"
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


[Link] = "Button from SY has been Clicked!"
End Sub
End Class
XII. Results (output of the program)

GUI Application Development using [Link] (22034) Page 1


Practical No. 12: Design windows application using Tab Control & Timer.

XIII. Practical related Questions


1. Write a procedure to display the icons on the Toolbar Control.
 ToolBar buttons are able to display icons within them for easy identification by users.
This is achieved through adding images to the ImageList Component component and then
associating the ImageList component with the ToolBar control.

To set an icon for a toolbar button programmatically

1. In a procedure, instantiate an ImageList component and a ToolBar control.


2. In the same procedure, assign an image to the ImageList component.
3. In the same procedure, assign the ImageList control to the ToolBar control and
assign the ImageIndex property of the individual toolbar buttons.

2. Difference between Form and Panel Control in [Link]


 Windows Forms Panel controls are used to provide an identifiable grouping for other
controls. Typically, you use panels to subdivide a form by function. The Panel control is
similar to the GroupBox control; however, only the Panel control can have scroll bars, and
only the GroupBox control displays a caption.

XIV. Exercise
1. Write a program to display the traffic signal using timer control.

Public Class Form1

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles [Link]


If [Link] Then
[Link] = False
[Link] = True
[Link] = False
ElseIf [Link] Then
[Link] = False
[Link] = False
[Link] = True
ElseIf [Link] Then

GUI Application Development using [Link] (22034) Page 2


Practical No. 12: Design windows application using Tab Control & Timer.

[Link] = True
[Link] = False
[Link] = False
End
If End
Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]


[Link] = True
[Link] = 1600
[Link] = True
[Link] = False
[Link] = False
End Sub

Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles


[Link]

End Sub
End Class
OUTPUT:

3. Write a program to demonstrate the Tab Control in [Link].

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]


[Link] = "FY"
[Link] = "SY"
End Sub

GUI Application Development using [Link] (22034) Page 3


Practical No. 12: Design windows application using Tab Control & Timer.

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


[Link]("TY")
End Sub
End Class
OUTPUT:

GUI Application Development using [Link] (22034) Page 4


Practical No. 13 & 14: Implement a Windows application to Perform Validation on various control.

Practical No 13 & 14
VIII. Resources required (Additional)
 If any web resources required.

X. Resources used (Additional)


 [Link]
 [Link]
 [Link]

XI. Program Code


1. Write a program using Error Provider and Regular Expression.

Imports [Link]
Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


Dim regex As Regex = New Regex("^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-
9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
Dim isValid As Boolean = [Link]([Link])
If Not isValid Then
[Link](TextBox1, "Invalid E-mail ID")
Else
MsgBox("Valid E-Mail ID")
End If
End Sub

End Class
XII. Results (Output of the Program)

GUI Application Development using [Link] (22034) Page 1


Practical No. 13 & 14: Implement a Windows application to Perform Validation on various control.

XIII. Practical related Questions


1. Enlist the different constructs for Regular Expressions.
 Constructs for Defining Regular Expressions
There are various categories of characters, operators, and constructs that lets you to define
regular expressions. Click the following links to find these constructs.
 Character escapes
 Character classes
 Anchors
 Grouping constructs
 Quantifiers
 Backreference constructs
 Alternation constructs
 Substitutions
 Miscellaneous constructs

2. Write the program code to perform validation using ErrorProvider Control.


Imports [Link]
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
Dim regex As Regex = New Regex("(((0|1)[0-9]|2[0-9]|3[0-1])\/(0[1-9]|1[0-2])
\/((19|20)\d\d))$")
Dim b As Boolean = [Link]([Link])
If Not b Then
[Link](TextBox1, "Invalid Format")
Else
MsgBox("Valid Format")
[Link](TextBox1, "")
End If
End Sub
End Class

GUI Application Development using [Link] (22034) Page 2


Practical No. 13 & 14: Implement a Windows application to Perform Validation on various control.

OUTPUT:

XIV. Exercise
1. Write a program using ErrorProvider for username and password authentication.

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


If [Link] = "" Then
[Link](TextBox1, "Please Enter Your Name")
Else
[Link](TextBox1, "")
End If
If [Link] = "" Then
[Link](TextBox2, "Please Enter Your Password")
Else
[Link](TextBox2, "")
End
If End
Sub
End Class

GUI Application Development using [Link] (22034) Page 3


Practical No. 13 & 14: Implement a Windows application to Perform Validation on various control.

OUTPUT:

2. Write a program using ErrorProvider for control to validate Mobile Number and
Email ID in GUI appnlication.

Imports [Link]
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
Dim number As New Regex("\d{10}")
If [Link]([Link]) Then
[Link](TextBox1, "")
MsgBox("Valid Phone Number")
Else
[Link](TextBox1, "Invalid Phone Number")
End If
Dim regex As Regex = New Regex("^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-
9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
Dim isValid As Boolean = [Link]([Link])
If Not isValid Then
[Link](TextBox2, "Invalid E-mail ID")
Else
[Link](TextBox2, "")
MsgBox("Valid E-Mail ID")
End If
End Sub
End Class
GUI Application Development using [Link] (22034) Page 4
Practical No. 13 & 14: Implement a Windows application to Perform Validation on various control.

OUTPUT:

GUI Application Development using [Link] (22034) Page 5


Practical No. 15: Write a program to demonstrate use of Sub-procedures and parameterized
Sub-Procedure.

Practical No 15

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 [Link]
features/procedures/sub-procedures
 [Link]
features/procedures/procedure-parameters-and-arguments

XI. Program Code


1. Write a program using sub procedure and parameterized sub procedure
 Module Module1

Sub Main()
displaymsg()
Dim a, b As Integer
[Link]("Enter
Value")
a = [Link]()
b =
[Link]()
Add(a, b)
[Link]()
End Sub
Sub displaymsg()
[Link]("Use of sub-
procedure") End Sub
Sub Add(ByVal a As Integer, ByVal b As Integer)
[Link]("Addition = " & a + b)
End Sub

End Module

XII. Results (output of the


program) Use of sub-
procedure Enter Value
10
10
Addition = 20

GUI Application Development using [Link] (22034) Page 1


Practical No. 15: Write a program to demonstrate use of Sub-procedures and parameterized
Sub-Procedure.

XIII. Practical related Questions


1. Differentiate between ByVal and ByRef keywords in parameter passing of Sub
Procedure.
 ByVal and ByRef in VB .NET. When you pass arguments over to Subs and Function you can
do so either By Value or By Reference. By Value is shortened to ByVal and By Reference is
shortened to ByRef. ByVal means that you are passing a copy of a variable to your
Subroutine.

2. Write the program using Recursion. (Factorial of Number)


 Module Module1

Sub Main()
Dim num As Integer
[Link]("Enter a
Number") num = [Link]()
factorial(num)
[Link]()
End Sub
Sub factorial(ByVal num As
Integer) ' local variable
declaration */ Dim i,
factorial As Integer
factorial = 1
For i = 1 To num
factorial = factorial *
i Next i
[Link]("Factorial=" & factorial)
[Link]()
End
Sub End
Module
OUTPUT:
Enter a Number
5
Factorial=120

GUI Application Development using [Link] (22034) Page 2


Practical No. 15: Write a program to demonstrate use of Sub-procedures and parameterized
Sub-Procedure.

XIV. Exercise

1. Develop a program to calculate the Fibonacci Series of Give Number.


 Module Module1

Sub Main()
Fibonacci(10)
[Link]()
End Sub
Sub Fibonacci(ByVal n As
Integer) Dim a As Integer =
0
Dim b As Integer =
1 Dim i As
Integer For i = 0
To n - 1
Dim temp As
Integer temp = a
a = b
b = temp + b
[Link](
a)
Next
End Sub
End Module
OUTPUT:
1
1
2
3
5
8
13
21
34
55

2. Develop a program to print the reverse of any number using Sub procedure.
 Module Module1
Sub Main()
Dim num As Integer
[Link]("Enter
Number") num =
[Link]() reverse(num)
[Link]()
End Sub
Sub reverse(ByVal num As

GUI Application Development using [Link] (22034) Page 3


Practical No. 15: Write a program to demonstrate use of Sub-procedures and parameterized
Sub-Procedure.
Integer) Dim number = num
Dim result As Integer
While number > 0

GUI Application Development using [Link] (22034) Page 4


Practical No. 15: Write a program to demonstrate use of Sub-procedures and parameterized
Sub-Procedure.

num = number Mod 10


result = result * 10 +
num number = number \
10
End While
[Link]("" &
result) End Sub
End Module
OUTPUT:
Enter Number
123
Reverse Number =321

GUI Application Development using [Link] (22034) Page 5


Practical No. 16: Write a program to demonstrate use of Simple Function and parameterized
Function.

Practical No 16

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 [Link]
reference/statements/function-statement
 [Link]

XI. Program Code


1. Write a program using Simple Function and Parameterized Function.
 Module Module1
Sub Main()
show()
Dim a, b As Integer
[Link]("Enter Two Numbers")
a = [Link]()
b = [Link]()
Add(a, b)
[Link]("Addition is = " & Add(a, b))
[Link]()
End Sub
Public Function show()
[Link]("This is Simple Function")
End Function
Public Function Add(ByVal i As Integer, ByVal j As Integer)
Dim sum As Integer
sum = i + j
Return sum
End Function
End Module

XII. Results (output of the program)


This is Simple Function
Enter Two Numbers
45
65
Addition is = 110

GUI Application Development using [Link] (22034) Page 1


Practical No. 16: Write a program to demonstrate use of Simple Function and parameterized
Function.

XIII. Practical related Questions


1. Function returns a value (TRUE / FALSE).
 Function returns a value - True

2. Error – ‘Tyep Expected’


 Corrected Code
Function FindMax(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
Dim result As Integer
If (num1 > num2) Then
result = num1
Else
result = num2
End If
FindMax = result
End Function

XIV. Exercise
1. Write a program to identify maximum number using parameterized function.
(Use two Textbox for input a integer number and display output in Message
Box)

Public Class Form1


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
[Link]
Dim a, b As
Integer Dim res As
Integer
a = Val([Link])
b =
Val([Link])
Call findmax(a, b)
res = findmax(a, b)
[Link]("Maximum Number is" &
res) [Link]()
End Sub
Private Function findmax(ByVal num1 As Integer, ByVal num2 As
Integer) Dim result As Integer

If (num1 > num2)


Then result =
num1
Else
result = num2

GUI Application Development using [Link] (22034) Page 2


Practical No. 16: Write a program to demonstrate use of Simple Function and parameterized
Function.
End If
findmax =
result End Function
End Class

GUI Application Development using [Link] (22034) Page 3


Practical No. 16: Write a program to demonstrate use of Simple Function and parameterized
Function.

OUTPUT:

2. Write a program using recursion(Factorial).


 Module Module1
Sub Main()
Dim n As Integer
[Link]("Enter
Number=") n =
[Link]()
[Link]("Result=")
[Link](Fact(n))
[Link]()
End Sub
Function Fact(ByVal n As
Integer) If n = 0 Then
Fact = 1
Else
Fact = n * Fact(n -
1) End If
End
Function End
Module
OUTPUT:
Enter Number=
5
Result=
120

GUI Application Development using [Link] (22034) Page 4


Practical No. 17: Understand the Concept of Class and Object of Class.

Practical No 17

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 [Link]
reference/statements/function-statement
 [Link]

XI. Program Code


1. Write a program using the concept of class & object in [Link].
 Module Module1
Sub Main()
Dim obj As New Test 'creating a object obj for Test
Class [Link]() 'Calling the disp method using
obj [Link]()
End Sub
End Module
Public Class
Test Sub
disp()
[Link]("Welcome to
[Link]") End Sub
End Class

XII. Results (output of the program)


Welcome to [Link]

XIII. Practical related Questions


1. Find output in following code.
 4

2. Find Error in following code.


Module Module1
Sub Main()
Dim b As B = New B(5)
B = Display()

Dim c As C = New C(5)


B = Display()
End Sub
 Compilation error (line 3, col 0): Type 'B' is not defined.
Compilation error (line 4, col 0): 'Display' is not declared. It may be inaccessible due to its protectio
n level.
Compilation error (line 6, col 0): Type 'C' is not defined.
Compilation error (line 7, col 0): 'Display' is not declared. It may be inaccessible due to its protectio
n level.

GUI Application Development using [Link] (22034) Page 1


Practical No. 17: Understand the Concept of Class and Object of Class.

XIV. Exercise
1. Write a program to identify Volume of Box Class, with three data members,
length, breadth and height.
 Module Module1
Sub Main()
Dim obj As Box = New Box()
Dim vol As Integer
vol = [Link](2, 4, 4)
[Link]("Length =" &
obj.l) [Link]("Breadth
=" & obj.b)
[Link]("Height =" &
obj.h) [Link]("Volume ="
& vol) [Link]()
End Sub
Class Box
Public l, b, h As Integer
Function volume(ByVal i As Integer, ByVal j As Integer,
_ByVal k As Integer)
Dim v As
Integer l = i
b = j
h = k
v = l * b *
h Return v
End
Function End
Class
End Module

Output:

2. Implement a program to accept values from Combo Box and Display average of this
in message box using class.

GUI Application Development using [Link] (22034) Page 2


Practical No. 17: Understand the Concept of Class and Object of Class.

Public Class Form1

Private Sub Form1_Load(sender As Object, e As


EventArgs) Handles [Link]
[Link](5
)
[Link](8
)
[Link](1
2)
[Link](2
0)
[Link](3
2)

[Link](6)
[Link](1
1)
[Link](1
7)
[Link](2
4)
[Link](3
6)
End Sub

Private Sub Button1_Click(sender As Object, e As


EventArgs) Handles [Link]
Dim average As Single
average = (Val([Link]) +
OUTPUT
:

GUI Application Development using [Link] (22034) Page 3


Practical No.18: Implement a Program For Class Constructor and Destructor To De-Allocate
Memory.

Practical No 18

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 [Link]
reference/statements/function-statement
 [Link]

XI. Program Code


1. Write a program to demonstrate the use of constructor & destructor.
 A)
Constructor-
Module
Module1 Sub
Main()
Dim obj As New syco
[Link]()
[Link]()
End Sub
Public Class syco
Public Function show()
[Link]("This is base
class")
End
Function
Sub New()
[Link]("Constructor
Executed") End Sub
End Class
End Module

OUTPUT:
Constructor Executed
This is base class

Module
Module1
Sub
Main()
Dim obj As New syco
[Link]()
End
Sub End
Module
Public Class syco
Public Function show()
[Link]("This is base
Class")
GUI Application Development using [Link] (22034) Page 1
Practical No.18: Implement a Program For Class Constructor and Destructor To De-Allocate
Memory.
End Function
Protected Overrides Sub Finalize()
[Link]("Destructor executing here")
[Link]()
End
Sub End
Class

GUI Application Development using [Link] (22034) Page 2


Practical No.18: Implement a Program For Class Constructor and Destructor To De-Allocate
Memory.

OUTPUT:
This is base class
Destructor executing here

XII. Results (output of the program)


a. Constructor
Executed This is base
class
b. This is base class
Destructor executing here

XIII. Practical related Questions


1. Find output in following code.
 40

2. Find Error in following code.


Imports [Link]
Module Module1
Sub Main()
Dim obj As New Destroy()
End Sub
End Module
Public Class Destroy
Protected Overrides Finalize()
Write(“[Link]”)
Read()
End Sub
End Class
 Error 1 'Overrides' is not valid on a member variable declaration.
Warning 2 variable 'Finalize' conflicts with sub 'Finalize' in the base class 'Object'
and should be declared 'Shadows'.
Error 3 Declaration expected.
Error 4 Declaration expected.
Error 5 'End Sub' must be preceded by a matching 'Sub'.

GUI Application Development using [Link] (22034) Page 3


Practical No.18: Implement a Program For Class Constructor and Destructor To De-Allocate
Memory.

XIV. Exercise
1. Implement a program to display any message at run time.(Using Constructor).
 Module Module1
Sub Main()
Dim obj As New sample
[Link]()
[Link]()
End Sub
Class sample
Public Sub New()
[Link]("This is
Constructor") End Sub
Sub display()
[Link]("This is
Method") End Sub
End Class
End Module

Output:

2. Implement a program to calculate area of circle using parameterized constructor.


 Module Module1
Sub Main()
Dim obj As New
circle(2) [Link]()
[Link]()
End Sub
Class
circle
Dim p As Double = 3.14
Dim r, a As Double
Public Sub New(ByVal i As
Integer) r = i
End Sub
Sub
area()[Link]("Area of Circle = " &
a) End Sub
End Class
End Module

OUTPUT:
Area of Circle = 12.56

GUI Application Development using [Link] (22034) Page 4


Practical No.19: Develop a Program For Inheritance.

Practical No 19

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write a program using concept of Inheritance.
 Module Module1

Sub Main()
Dim obj As New
details [Link]()
[Link]()
End

Sub End

Module

Public Class student 'Base


Class Public branch As String =
"Computer"
End Class

Public Class details 'Derived


Class Inherits student
Public Function show()
[Link]("Branch = " &
branch) Return 0
End
Function End
Class

XII. Results (output of the


program) Branch =
Computer

GUI Application Development using [Link] (22034) Page 1


Practical No.19: Develop a Program For Inheritance.

XIII. Practical related Questions


1. Find output in following class.
 My Base Class
My Child Class

2. Find Error in following code.


Public Class Person
Public FirstName As
String Public LastName
As String Public
DateOfBirth As Date
Public Gender As String
Public ReadOnly Property FullName() As
String Get
Get
Return FirstName & " " &
LastName End Get
End
Property End
Class
Public Class Customer=>Inherits
Person Public CustomerID As
String
Public CustomerType As
String End Class
 Error 1 'Sub Main' was not found in 'ConsoleApplication1.Module1'.

Warning2 Property 'FullName' doesn't return a value on all code paths. A null reference
exception could occur at run time when the result is used.

Error 3 Statement cannot appear within a method body. End of method assumed.

Error 4 End of statement expected.

GUI Application Development using [Link] (22034) Page 2


Practical No.19: Develop a Program For Inheritance.

XIV. Exercise
1. Implement a program for inheritance where Student is Child Class and faculty is Base
class.(Take Appropriate variable in Base and Child class)
 Module Module1

Sub Main()
Dim s As New student
[Link]()
[Link]()
[Link]()
End Sub

Class faculty
Dim b As String =
"Computer" Sub branch()
[Link]("Branch = " &
b) End Sub
End Class
Class
student
Inherits faculty
Dim y As String = "Second
Year" Sub year()
[Link]("Year = " &
y) End Sub
End Class
End Module

Output:

GUI Application Development using [Link] (22034) Page 3


Practical No.20 & 21: Implement a Program For Overloading & Overriding.

Practical No 20 & 21

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write a program to implement the concept of method overloading & overriding.
 Overloading:
Module Module1

Sub Main()
Dim res As New addition
[Link]("Overloaded Values of Class
addition") [Link]([Link](10))
[Link]([Link](35, 20))
[Link]()
End Sub

End Module

Public Class addition


Public i, j As Integer
Public Function add(ByVal i As Integer) As Integer
Return i
End Function

Public Function add(ByVal i As Integer, ByVal j As Integer) As Integer


Return i + j
End Function
End Class

Output:
Overloaded Values of Class addition
10
55

GUI Application Development using [Link] (22034) Page 1


Practical No.20 & 21: Implement a Program For Overloading & Overriding.

Overriding:
Module Module1

Sub Main()
Dim obj As New child
Dim result As Integer
result = [Link](10, 5)
[Link]("Overloaded Values of Class
addition") [Link]("Result =" & result)
[Link]()
End Sub
End Module
Public Class parent
Public Overridable Function add(ByVal i As Integer, ByVal j As Integer)
Return (i + j)
End Function
End Class

Public Class child


Inherits parent
Public Overrides Function add(ByVal i As Integer, ByVal j As Integer)
[Link]("Result of Addition =" & [Link](12, 18))
Return (i + j)
End Function
End Class

Output:
Result of Addition =30
Overloaded Values of Class addition
Result =15

XII. Results (output of the program)


In the above overloading example the same function add is called to perform different
operations based on different arguments.
In the above overriding the parent class function add is overridden in the child class
using the [Link](12, 18) statement. So first the overridden value is displayed, then the value
from child class is display.

GUI Application Development using [Link] (22034) Page 2


Practical No.20 & 21: Implement a Program For Overloading & Overriding.

XIII. Practical related Questions


1. Find output of following Code.
 Area of the Circle : 31.181246
Area of the Rectangle : 20
2. Implement windows application for employee details using overriding method.
 Module Module1

Sub Main()
Dim obj As New
EmpInfo
[Link]()
[Link]()
End Sub

End Module
Public Class
EmpPersonalDetails Dim
name As String
Dim address As String
Public Overridable Function ShowInfo()
[Link]("Employee Name" & name)
[Link]("Employee Address" & address)
End
Function End
Class
Public Class EmpInfo
Inherits EmpPersonalDetails
Dim EmpId As Integer
Dim sallary As Integer
Dim JoinDate As Date
Overloads Function ShowInfo()
[Link]()
[Link]("Employee ID" &
EmpId)
[Link]("Employee Sallary" & sallary)
[Link]("Employee Joining Date" & JoinDate)
End
Function End
Class
OUTPUT:
Employee Name
Employee Address
Employee ID0
Employee Sallary0
Employee Joining Dat[Link] AM

GUI Application Development using [Link] (22034) Page 3


Practical No.20 & 21: Implement a Program For Overloading & Overriding.

XIV. Exercise
1. Implement a windows application for show string concatenation using
overload method

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


Dim str1, str2, str3 As String
str1 = [Link]
str2 = [Link]

str3 = str1 + str2


[Link] = str3
End Sub

End Class

Output:

GUI Application Development using [Link] (22034) Page 4


Practical No.22: Implement a Program to Demonstrate Shadowing In Inheritance.

Practical No 22

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write a program to using shadowing in inheritance.
 Module Module1
Sub Main()
Dim p As New parent
Dim c As New child
[Link]()
[Link]()
[Link](" ")
[Link]()
[Link]()
[Link]()
End Sub
Public Class parent
Public Sub disp()
[Link]("Parent")
End Sub
Public Sub use()
[Link]()
End Sub
End Class
Public Class child
Inherits parent
Public Shadows Sub disp()
[Link]("Child")
End Sub
End Class
End Module

Output:
Parent
Parent

Parent
Child

GUI Application Development using [Link] (22034) Page 1


Practical No.22: Implement a Program to Demonstrate Shadowing In Inheritance.

XIII. Practical related Questions


1. Write output of following Code.

Class Shadow
Shared x As Integer = 1
Shared Sub Main()
Dim x As Integer = 10
[Link]("main:x" & x)
[Link]("main shadow x:" &
Shadow.x)
End Sub
End Class

 Error 1 'Sub Main' was not found in


'ConsoleApplication22.Module1'. ConsoleApplication22

2. Write output of following Code.

Public Class Form2


Dim x As Integer = 10
Private Sub Button1_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim x As Integer = 30
MsgBox(x)
End Sub
End Class

 Error 1 Handles clause requires a WithEvents variable defined in the containing


type or one of its base types.

GUI Application Development using [Link] (22034) Page 2


Practical No.22: Implement a Program to Demonstrate Shadowing In Inheritance.

XIV. Exercise
1. Implement the concept of shadowing through inheritance in a console application.
 Module Module1
Dim f As New
first
Dim s As New second
Dim t As New third
Sub Main()
[Link]()
[Link]()
[Link]()
[Link]()
End Sub
End Module
Public Class first
Public Sub display()
[Link]("This is First Year")
End Sub
End Class
Public Class second
Inherits first
Private Shadows Sub display()
[Link]("This is Second Year")
End Sub
End Class
Public Class third
Inherits second
Public Shadows Sub display()
[Link]("This is Third Year")
End Sub
End Class
OUTPUT:
This is First Year
This is First Year
This is Third Year

GUI Application Development using [Link] (22034) Page 3


Practical No.23: Implement a Program to handle runtime errors using Exception handling.

Practical No 23

VIII. Resources required (Additional)


→ If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write any program using Exception handling.

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


Dim num1, num2, div As Integer
num1 = Val([Link])
num2 = Val([Link])
Try
div = num1 / num2
MsgBox("Division is" & div)
Catch ex As OverflowException
[Link]("Division of {0} by zero", num1)

End Try
End Sub
End Class

Output:

A first chance exception of type '[Link]' occurred in


[Link]
Division of 5 by zero

GUI Application Development using [Link] (22034) Page 1


Practical No.23: Implement a Program to handle runtime errors using Exception handling.

XIII. Practical related Questions


1. Write output of following Code.

Module Module1

Sub Main()
Try
Throw New Exception("Mega-error")
Catch ex As Exception
[Link]([Link])

End Try
[Link]()
End Sub

End Module

Output:
Mega-error

2. Write output of following Code.

Module Module1

Sub Main()
Try
'Try to divide by zero.
Dim value As Integer = 1 / [Link]("0")
'This statement is sadly not reached.
[Link]("Hi")
Catch ex As Exception
'Display the Message.
[Link]([Link])

End Try
[Link]()
End Sub

End Module
Output:
Arithmetic operation resulted in an overflow.

GUI Application Development using [Link] (22034) Page 2


Practical No.23: Implement a Program to handle runtime errors using Exception handling.

XIV. Exercise
1. Write a program for student registration using exception handling.

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


Try
If [Link] = "" Or [Link] = "" Then
Throw (New Exception("Fill Data"))
Else
MsgBox([Link] & [Link])
End If
Catch ex As Exception
MsgBox([Link])
Finally
MsgBox("Thank You")
End Try
End Sub
End Class

OUTPUT:

GUI Application Development using [Link] (22034) Page 3


Practical No.24: Understand the concept of [Link]

Practical No 24

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write a program using [Link] to the database.

Imports [Link]
Imports [Link]

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]


Dim conn As New OleDbConnection("Provider=[Link].4.0;Data " &
"Source=C:\Users\Suresh\Documents\Visual Studio 2012 \ Projects \ Datagrid \
[Link]")
[Link]()
Dim cmd As New OleDbCommand("Select * From Marks", conn)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
[Link](ds, "Marks")
[Link] = "marks"
[Link] = ds
[Link] = "marks"

End Sub

End Class

GUI Application Development using [Link] (22034) Page 1


Practical No.24: Understand the concept of [Link]

Output:

XIII. Practical related Questions


1. Find error from following code
Dim con As New OleDbConnection("Provider=[Link].4.0DataSource=D:\
[Link];")

 Error 1 Type expected.


Error 2 'OleDbConnection' is a type and cannot be used as an expression.
Error 3 'Conn' is not declared. It may be inaccessible due to its protection
level.

2. Write a connection string with MS-access using any database.


 Provider=[Link].4.0;Data Source=C:\[Link]

GUI Application Development using [Link] (22034) Page 2


Practical No.24: Understand the concept of [Link]

XIV. Exercise
1. Design the windows application that will display the content of a table in MS-
Access database on DataGrid control using data adapter.


Imports [Link]
Imports [Link]
Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]


Dim conn As New OleDbConnection("Provider=[Link].4.0;Data” &
“Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\DataGrid1\
[Link]")
[Link]()
Dim cmd As New OleDbCommand("Select *From Student", conn)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
[Link](ds, "Roll Call")
[Link] = "Student"
[Link] = ds
[Link] = "Roll Call"

End Sub
End Class

OUTPUT:

GUI Application Development using [Link] (22034) Page 3


Practical No.24: Understand the concept of [Link]

GUI Application Development using [Link] (22034) Page 4


Practical No.25 & 26: Understand the concept of Data Adapter

Practical No 25 & 26

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write a program using data adapter to connect to the database.

Imports [Link]
Imports [Link]

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]


Dim conn As New OleDbConnection("Provider=[Link].4.0;Data " &
"Source=C:\Users\Suresh\Documents\Visual Studio 2012 \ Projects \ Datagrid \
[Link]")
[Link]()
Dim cmd As New OleDbCommand("Select * From Marks", conn)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
[Link](ds, "Marks")
[Link] = "marks"
[Link] = ds
[Link] = "marks"

End Sub

End Class

GUI Application Development using [Link] (22034) Page 1


Practical No.25 & 26: Understand the concept of Data Adapter

Output:

XIII. Practical related Questions


1. Find error from following code
Dim adp As OleDbConnection("Provider=[Link].4.0DataSource=D:\
[Link];")

 Error 1 Type expected.


Error 2 'OleDbConnection' is a type and cannot be used as an expression.
Error 3 'Conn' is not declared. It may be inaccessible due to its protection
level.

2. Write a data adapter syntax using a MS-access code with a student table.
 Dim da As OleDbDataAdapter
Da=New OleDbDataAdapter(cmd)

GUI Application Development using [Link] (22034) Page 2


Practical No.25 & 26: Understand the concept of Data Adapter

XIV. Exercise
1. Design the windows application in MS-Access which have navigation (Next,
First, Previous, Last).


Imports [Link]
Public Class Form1
Dim con As OleDbConnection
Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]
'TODO: This line of code loads data into the '[Link]' table. You can
move, or remove it, as needed.
[Link]([Link])
con = New OleDbConnection("Provider=[Link].4.0;Data Source=C:\
Users\Suresh\Documents\Visual Studio 2012\Projects\Nav2\[Link]")
[Link]()
cmd = New OleDbCommand("Select * From student", con)
da = New OleDbDataAdapter(cmd)
[Link](ds, "student")
[Link]("text", ds, "[Link]")
[Link]("text", ds, "[Link]")
[Link]("text", ds, "[Link]")
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


[Link](ds, "student").Position = 0
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


[Link](ds, "student").Position = [Link](ds,
"student").Position + 1
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles [Link]


[Link](ds, "student").Position = [Link](ds,

GUI Application Development using [Link] (22034) Page 3


Practical No.25 & 26: Understand the concept of Data Adapter
"student").Position - 1

GUI Application Development using [Link] (22034) Page 4


Practical No.25 & 26: Understand the concept of Data Adapter

End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles [Link]


[Link](ds, "student").Position=[Link](ds,"student").Count-1
End Sub
End Class
OUTPUT:

2. Develop a windows application that will contain multiple tables in a single dataset.

Imports [Link]
Public Class Form1
Dim con As OleDbConnection
Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


[Link]
Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Multiple Table\
[Link]")
[Link]()

Dim cmd1 As New OleDbCommand("Select * From student", con)

GUI Application Development using [Link] (22034) Page 5


Practical No.25 & 26: Understand the concept of Data Adapter

Dim cmd2 As New OleDbCommand("Select * From subjects", con)

Dim da1 As New OleDbDataAdapter(cmd1)


Dim da2 As New OleDbDataAdapter(cmd2)

Dim ds As New DataSet

[Link] = "Student Record"


[Link] = "Subject Details"

[Link](ds, "student")
[Link](ds, "subjects")

[Link] = ds
[Link] = "student"

[Link] = ds
[Link] = "subjects"
End Sub
End Class
OUTPUT:

GUI Application Development using [Link] (22034) Page 6


Practical No.27: Understand the concept of select & Insert data in database table.

Practical No 27

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write a program to insert the data & retrieve the data from database.

Imports [Link]
Public Class Form1
Dim con As OleDbConnection
Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]


Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Insert and Retrieve\
[Link]")
[Link]()
Dim InsertString As String
InsertString = "Insert into student(RollNo, Name, Marks) values('" + [Link] +
"','" + [Link] + "' ,'" + [Link] + "')"
Dim cmd As New OleDbCommand(InsertString, con)
[Link]()
MsgBox(" Record Successfully Inserted")
[Link]()
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles [Link]


Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Insert and Retrieve\
[Link]")
[Link]()
Dim cmd As New OleDbCommand("Select * From student", con)

GUI Application Development using [Link] (22034) Page 1


Practical No.27: Understand the concept of select & Insert data in database table.

Dim da As New OleDbDataAdapter(cmd)


[Link] = "Student Marks"
[Link](ds, "student")
[Link] = ds
[Link] = "student"
[Link]()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles [Link]


Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Insert and Retrieve\
[Link]")
[Link]()
Dim DeleteString As String
DeleteString = "Delete From student where RollNo ='" + [Link] + "'"
Dim cmd As New OleDbCommand(DeleteString, con)
[Link]()
MsgBox(" Record Successfully Deleted")
[Link]()
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles [Link]


Close()
End Sub
End Class

Output:

XIII. Practical related Questions


1. Write syntax of command object execute method.

1. ExecuteScaler():
dr = [Link]();
2. ExecuteReader():
dr = [Link]();
3. ExecuteNonQuery():
dr = [Link]();
GUI Application Development using [Link] (22034) Page 2
Practical No.27: Understand the concept of select & Insert data in database table.

XIV. Exercise
1. Design a simple Windowsform for accepting the details of Employee. Using the
connected architecture of [Link], perform the following operations:
 Insert Record
 Search Record
 Update Record
 Delete Record


Imports [Link]
Public Class Form1
Dim con As OleDbConnection
Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter
Private Sub btnIns_Click(sender As Object, e As EventArgs) Handles [Link]
Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Employee\
[Link]")
[Link]()
If [Link] = "" Then
MsgBox("Please Enter Employee Number")
Else
Dim InsertString As String
InsertString = "Insert into Employee(Emp_No, Emp_Name, Address,
Date_of_joining) values('" + [Link] + "','" + [Link] + "' ,'" + [Link] + "','"
+ [Link] + "')"
Dim cmd As New OleDbCommand(InsertString, con)
[Link]()
MsgBox(" Record Successfully Inserted")
[Link]()
[Link]()
[Link]()
[Link]()

[Link]()
End If
End Sub

GUI Application Development using [Link] (22034) Page 3


Practical No.27: Understand the concept of select & Insert data in database table.

Private Sub btnDel_Click(sender As Object, e As EventArgs) Handles [Link]


Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Employee\
[Link]")
[Link]()
If [Link] = "" Then
MsgBox("Please Enter Employee Number")
Else
Dim DeleteString As String
DeleteString = "Delete From Employee where Emp_No ='" + [Link] + "'"
Dim cmd As New OleDbCommand(DeleteString, con)
[Link]()
MsgBox(" Record Successfully Deleted")
[Link]()
[Link]()
[Link]()
End If

End Sub

Private Sub btnUpd_Click(sender As Object, e As EventArgs) Handles [Link]


Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Employee\
[Link]")
[Link]()
If [Link] <> "" Then
Dim UpdateString As String
UpdateString = "Update Employee SET Emp_No ='" + [Link] +
"',Emp_Name='" + [Link] + "',Address='" + [Link] + "',Date_of_joining='" +
[Link] + "' Where Emp_No ='" + [Link] + "'"
Dim cmd As New OleDbCommand(UpdateString, con)
[Link]()
MsgBox(" Record Successfully Updated")
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
Else
MsgBox(" Please Enter Employment Number")
End If
End Sub

Private Sub btnShow_Click(sender As Object, e As EventArgs) Handles [Link]


Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Employee\
[Link]")
[Link]()
Dim cmd As New OleDbCommand("Select * From Employee", con)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
[Link] = "Employee Record"
[Link](ds, "Employee")

GUI Application Development using [Link] (22034) Page 4


Practical No.27: Understand the concept of select & Insert data in database table.

[Link] = ds
[Link] = "Employee"
[Link]()
End Sub

Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles


[Link]
If [Link] = "" Then
MsgBox("Please Enter Employee Number")
Else
Dim con As New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\Employee\
[Link]")
[Link]()
Dim cmd As New OleDbCommand("Select * From Employee where Emp_No like '" +
[Link] + "'", con)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
[Link] = "Employee Record"
[Link](ds, "Employee")
[Link] = [Link]("Employee")
[Link]()
[Link]()
[Link]()
[Link]()
End
If End
Sub
End Class

OUTPUT:

GUI Application Development using [Link] (22034) Page 5


Practical No.28, 29 & 30: Understand the concept of data Binding.

Practical No 28, 29 & 30

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


[Link]

XI. Program Code


1. Write a program using data binding in [Link]

Imports [Link]
Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]

Dim con As OleDbConnection


Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter

con = New OleDbConnection("Provider=[Link].4.0;Data Source=C:\


Users\Suresh\Documents\Visual Studio 2012\Projects\Data binding\[Link]")
[Link]()

cmd = New OleDbCommand("Select * From student", con)


da = New OleDbDataAdapter(cmd)
[Link](ds, "student")

[Link]("Text", ds, "student.Roll_No")


[Link]("Text", ds, "[Link]")
[Link]("Text", ds, "[Link]")

End Sub
End Class

GUI Application Development using [Link] (22034) Page 1


Practical No.28, 29 & 30: Understand the concept of data Binding.

Output:

XIII. Practical related Questions


1. Write syntax of simple binding for text box.
 [Link](“Text”, Dataset11, ”[Link]”)
2. Write a syntax of complex binding for combo box.
 [Link]=[Link](“table_name”)
[Link]=”field_name”

XIV. Exercise
1. Design a windows application for student name and college name using a simple
data binding use appropriate database.


Imports [Link]
Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]


Dim con As OleDbConnection
Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter
con = New OleDbConnection("Provider=[Link].4.0;Data
Source=C:\Users\Suresh\Documents\Visual Studio 2012\Projects\student data
binding\[Link]")

GUI Application Development using [Link] (22034) Page 2


Practical No.28, 29 & 30: Understand the concept of data Binding.
[Link]()

GUI Application Development using [Link] (22034) Page 3


Practical No.28, 29 & 30: Understand the concept of data Binding.

cmd = New OleDbCommand("Select * From Student", con)


da = New OleDbDataAdapter(cmd)
[Link](ds, "Student")
[Link]("text", ds, "[Link]")
[Link]("text", ds, "[Link]")
End Sub
End Class

OUTPUT:

2. Design a windows application for bank customer record & display it using Complex
data binding use appropriate database.

Imports [Link]
Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles [Link]

Dim con As OleDbConnection


Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter

con = New OleDbConnection("Provider=[Link].4.0;Data Source=C:\


Users\Suresh\Documents\Visual Studio 2012\Projects\Bank Customer Record\[Link]")
[Link]()

cmd = New OleDbCommand("Select * From Bank_Details", con)


da = New OleDbDataAdapter(cmd)
[Link](ds, "Bank_Details")

[Link] = [Link]("Bank_Details")

GUI Application Development using [Link] (22034) Page 4


Practical No.28, 29 & 30: Understand the concept of data Binding.

[Link] = [Link]("Bank_Details")
[Link] = [Link]("Bank_Details")

[Link] = "Acc_No"
[Link] = "Balance"
[Link] = "Branch"

End Sub
End Class

OUTPUT:

GUI Application Development using [Link] (22034) Page 5

You might also like