VB Program
VB Program
VB Program
Using Namespaces
AIM:
ALGORITHM:
Step 4: Create a module and Declare variables a, b and set the data type as integer
Step 5: Include the function in the module and Get input from user in the sub main()
in the module1.
Step 6: Using those functions in the class, calculate the two inputs and display the
result.
OUTPUT:-
2.Passing Arrays
AIM:
ALGORITHM:
Step 3: declare the variables as byval array and byref array as integer
Sub Main()
Dim vala(10) As Integer
Dim refb(10) As Integer
Call arrayvalref(vala, refb)
Console.WriteLine("display the number using byval")
Console.WriteLine(UBound(vala))
Console.WriteLine("display the number using byref")
Console.WriteLine(UBound(refb))
Console.ReadKey()
End Sub
Sub arrayvalref(ByVal arr1() As Integer, ByRef arr2() As Integer)
ReDim arr1(100)
ReDim arr2(200)
End Sub
End Module
output
3.Sum of Array Elements
AIM:
ALGORITHM:
Step 4: Write a function to calculate the sum of array elements and to get the
average.
Sub Main()
Console.WriteLine("Name:MANESH.M")
Console.WriteLine("Reg No:14BCS021")
End Sub
End Module
OUTPUT:-
4.Changing Back Color
AIM
Create a windows application using horizontal scrollbar to change the form back
color.
ALGORITHM
Step 4: Set the values of horizontal scroll bar in the properties windows as
min value=0, max value=225
Step 5: use one scrollbar procedure for handling all scrollbar value to set the
background color of the form
End Class
OUTPUT:-
5.Calculator
AIM
ALGORITHM
Step 4: Set the values of the buttons in the properties windows as numbers from 0-9
as in a calculator and remaining buttons as +, -, *, /, dot, clear and ac.
Step 5: Code the buttons to perform various functions and display the result.
End Sub
End Sub
End Sub
End Sub
End Class
OUTPUT:-
6.Implementing Message Box() & InputBox()
AIM
ALGORITHM
OUTPUT:-
7.Notepad application
AIM:
ALGORITHM:
Step 3: Drag the menu script control and place in the form to create menu and
sub menu.
FORM1.VB:-
Output:-
8.College website
AIM:
ALGORITHM:
about.aspx
<%@ Page Title="About Us" Language="VB" MasterPageFile="~/Site.Master"
AutoEventWireup="false"
CodeFile="About.aspx.vb" Inherits="About" %>
site.master
<%@ Master Language="VB" AutoEventWireup="false" CodeFile="Site.Master.vb"
Inherits="Site" %>
</div>
</form>
</body>
</html>
Site.css
/* DEFAULTS
----------------------------------------------------------*/
body
{
background: #b6b7bc;
font-size: .80em;
font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica,
Verdana, sans-serif;
margin: 0px;
padding: 0px;
color: #696969;
}
a:link, a:visited
{
color: #034af3;
}
a:hover
{
color: #1d60ff;
text-decoration: none;
}
a:active
{
color: #034af3;
}
p
{
margin-bottom: 10px;
line-height: 1.6em;
}
/* HEADINGS
----------------------------------------------------------*/
h1
{
font-size: 1.6em;
padding-bottom: 0px;
margin-bottom: 0px;
}
h2
{
font-size: 1.5em;
font-weight: 600;
}
h3
{
font-size: 1.2em;
}
h4
{
font-size: 1.1em;
}
h5, h6
{
font-size: 1em;
}
/* this rule styles <h1> and <h2> tags that are the
first child of the left and right table columns */
.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2
{
margin-top: 0px;
}
.page
{
width: 960px;
background-color: #fff;
margin: 20px auto 0px auto;
border: 1px solid #496077;
}
.header
{
position: relative;
margin: 0px;
padding: 0px;
background: #4b6c9e;
width: 100%;
}
.header h1
{
font-weight: 700;
margin: 0px;
padding: 0px 0px 0px 20px;
color: #f9f9f9;
border: none;
line-height: 2em;
font-size: 2em;
}
.main
{
padding: 0px 12px;
margin: 12px 8px 8px 8px;
min-height: 420px;
}
.leftCol
{
padding: 6px 0px;
margin: 12px 8px 8px 8px;
width: 200px;
min-height: 200px;
}
.footer
{
color: #4e5766;
padding: 8px 0px 0px 0px;
margin: 0px auto;
text-align: center;
line-height: normal;
}
/* TAB MENU
----------------------------------------------------------*/
div.hideSkiplink
{
background-color:#3a4f63;
width:100%;
}
div.menu
{
padding: 4px 0px 4px 8px;
}
div.menu ul
{
list-style: none;
margin: 0px;
padding: 0px;
width: auto;
}
div.menu ul li a:hover
{
background-color: #bfcbd6;
color: #465c71;
text-decoration: none;
}
div.menu ul li a:active
{
background-color: #465c71;
color: #cfdbe6;
text-decoration: none;
}
/* FORM ELEMENTS
----------------------------------------------------------*/
fieldset
{
margin: 1em 0px;
padding: 1em;
border: 1px solid #ccc;
}
fieldset p
{
margin: 2px 12px 10px 10px;
}
fieldset label.inline
{
display: inline;
}
legend
{
font-size: 1.1em;
font-weight: 600;
padding: 2px 4px 8px 4px;
}
input.textEntry
{
width: 320px;
border: 1px solid #ccc;
}
input.passwordEntry
{
width: 320px;
border: 1px solid #ccc;
}
div.accountInfo
{
width: 42%;
}
/* MISC
----------------------------------------------------------*/
.clear
{
clear: both;
}
.title
{
display: block;
float: left;
text-align: left;
width: auto;
}
.loginDisplay
{
font-size: 1.1em;
display: block;
text-align: right;
padding: 10px;
color: White;
}
.loginDisplay a:link
{
color: white;
}
.loginDisplay a:visited
{
color: white;
}
.loginDisplay a:hover
{
color: white;
}
.failureNotification
{
font-size: 1.2em;
color: Red;
}
.bold
{
font-weight: bold;
}
.submitButton
{
text-align: right;
padding-right: 10px;
}
OUTPUT:-
9.Number of hits
AIM:
ALGORITHM:
Step2: Open web site from visual studio with language vb.
Step3: Design the web page using two Labels and some content.
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
.style1
{
font-size: x-large;
}
</style>
</head>
<body style="font-weight: 700">
<form id="form1" runat="server">
<div style="font-weight: 700; font-style: italic">
</div>
<p>
your visitor
number:
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
</form>
</body>
</html>
GLOBAL.ASAX
DEFAULT.ASPX.VB
Partial Class webform1
Inherits System.Web.UI.Page
AIM:
To create a program to design a Web page using Tree view control which
displays college course details.
ALGORITHM:
Step 2 :Design the form using Label and “Tree view” control for college course
Details .
Step 3:Create Nodes & Sub nodes using node option in properties for UG courses
and PG course.
Step 5:Give Link for each web page in Tree view Node Editor using “Navigate Url”
property.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="Courses" Value="Courses">
<asp:TreeNode Text="UG" Value="UG" NavigateUrl="Defaultug.aspx">
</asp:TreeNode>
<asp:TreeNode Text="PG" Value="PG" NavigateUrl="Defaultpg.aspx">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Admissions" Value="Admissions"
NavigateUrl="Default2.aspx"></asp:TreeNode>
<asp:TreeNode Text="Contact Us" Value="Contact Us"
NavigateUrl="http://cmscbe.com/contact/"></asp:TreeNode>
</Nodes>
</asp:TreeView>
</form>
</body>
</html>
DEFAULT2.ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
DEFAULTUG.ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
AIM:
To create a program for SiteMapPath for any organization Form using all the
validation controls.
ALGORITHM:
Step 3: Design the webpage for organization using three LinkButton for
services, consultancy and contact details.
Step 4: Create web forms for home page, service page, consultant page, and
contact page and about us page. Link all the pages using the linkbutton created in
which page.
Step 5: Right Click on the application and add New Item sitemap in the
application which is an xml file and write the code for sitemap root nodes and child
nodes for all the web forms.
Step 6: Add a sitemap from navigation control from toolbox in each web
form. And sitmap path will be display in each page as per the code of XML file.
Home>services.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome To The HomePage<br />
<asp:LinkButton ID="LinkButton1" runat="server">Services</asp:LinkButton>
<br />
<asp:LinkButton ID="LinkButton2" runat="server">Consultancy</asp:LinkButton>
<br />
<asp:LinkButton ID="LinkButton3" runat="server">Contact Us</asp:LinkButton>
</div>
</form>
</body>
</html>
DEFAULT.ASPX.VB
SERVICES.ASPX.VB
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: center; font-size: x-large">
 
;
Welcome to the consulting page<br />
</div>
<p>
<asp:SiteMapPath ID="SiteMapPath1" runat="server"
style="top: 55px; left: 95px; position: absolute; height: 27px; width:
156px">
</asp:SiteMapPath>
</p>
</form>
</body>
</html>
CONTACT.ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: center; font-size: x-large">
 
;
Welcome to the contact page<br />
</div>
<p>
<asp:SiteMapPath ID="SiteMapPath1" runat="server"
style="top: 55px; left: 95px; position: absolute; height: 27px; width:
156px">
</asp:SiteMapPath></p></form></body></html>
WEB.SITEMAP
AIM:
To create a program to design a Web Registration Form using all the validation
controls.
ALGORITHM:
Step 3: Design a registration form with text boxes and label control to get the
information’s such as User Name, Age, Email id, Password, Confirm Password and
submit button.
Step 4: Add required flied validator to name text box and set the following
properties such as error message, text, control to validator with relevant information.
Step 5: Add range validator to age text box and set the following properties
such as error message ,text, maximum value, minimum value ,control to validate with
relevant information.
Step 6: Add regular expression validator to E Mail id text box and set the
following properties such as error message, text, validation expression, control to
validate with relevant information.
Step 7: Add required flied validator to password text box and set the following
properties such as error message, text, and control to validate with relevant
information.
Step 8: Add compare validator to confirm password text box and set the
following properties such as error message, text, control to compare, control to
validate with relevant information.
Step 9: Add Validation Summary Control to display all the Error Message. By
setting validation group property as “*” and text property also as “* “ for which
validation control including the submit button.
Step10: Go to solution explorer and right click website add new item
(Default2.aspx) rename the page as welcome.aspx.
Step11: write the code in submit button for checking if page is valid or not. If
All the fields are validated the redirect to the welcome.aspx page.
Step12: In welcome.aspx page design the page with message “ Thank you for
registering”
DEFAULT.ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<p style="text-align: center">
VALIDATION FORM</p>
<p>
<asp:Label ID="Label1" runat="server" Text="NAME"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="TextBox2" ErrorMessage="Age must be between 18 and 30"
ForeColor="Red" MaximumValue="30" MinimumValue="18"
style="z-index: 1; left: 546px; top: 97px; position: absolute; bottom: 332px"
ValidationGroup="*">*</asp:RangeValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox3" ErrorMessage="enter the correct email format"
ForeColor="Red" style="z-index: 1; left: 545px; top: 140px; position:
absolute"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ValidationGroup="*">*</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="ENTER THE NAME" ForeColor="Red"
style="z-index: 1; left: 545px; top: 55px; position: absolute; height: 18px;
width: 6px;"
ValidationGroup="*">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:Label ID="Label5" runat="server" Text="AGE"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</p>
<p>
<asp:Label ID="Label4" runat="server" Text="EMAIL"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</p>
<p>
<asp:Label ID="Label3" runat="server" Text="PASSWORD"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server" TextMode="Password"></asp:TextBox>
</p>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red"
style="z-index: 1; left: 220px; top: 356px; position: absolute; height: 38px;
width: 410px"
ValidationGroup="*" />
<p>
<asp:Label ID="Label2" runat="server" Text="CONFIRM PASSWORD"></asp:Label>
<asp:TextBox ID="TextBox5" runat="server" TextMode="Password"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox4" ControlToValidate="TextBox5"
ErrorMessage="PASSWORD MISMATCH" ForeColor="#FF3300"
style="z-index: 1; left: 547px; top: 193px; position: absolute; width: 9px;"
ValidationGroup="*">*</asp:CompareValidator>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="SUBMIT" ValidationGroup="*" />
</p>
</form>
</body>
</html>
DEFAULT.ASPX.VB
End If
End Sub
End Class
THANKYOU.ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
.style1
{
font-family: "Bodoni MT";
}
</style>
</head>
<body style="font-size: larger; font-family: 'Baskerville Old Face'">
<p style="text-align: center">
</p>
<p class="style1"
style="text-align: center; font-size: xx-large; color: #0000FF; font-weight: 700;
font-style: italic">
THANK YOU
</p>
<p style="text-align: center; font-size: xx-large; color: #0000FF; font-weight: 700;
font-style: italic">
</p>
<p style="text-align: justify">
</p>
</body>
</html>
13.DESIGNING A WEBPAGE
AIM:
ALGORITHM:
Step 3: In design, add some images, and datas about the webpage.
<br />
<a
href="http://www.google.co.in/url?
url=http://precisionenggworks.com/pew/centrifugal-monoblock-
pumps.html&rct=j&frm=1&q=&esrc=s&sa=U&ved=0ahUKEwiq-
Mq04pXPAhUMuo8KHb8YDPYQwW4ILzAN&usg=AFQjCNEYAm-3o4hfIiGKYMBucA04QJE1_w"><img
alt="Image result for images of pumps" height="100"
src="https://encrypted-tbn3.gstatic.com/images?
q=tbn:ANd9GcQJvqXeGNfRZs6rCyAzPpnTXhhcQS8cVblMJjC0UEKuvRzkg6tc_PTpAgY"
width="130"
/></a>  
; &nbs
p; &nb
sp; &n
bsp;
<a href="http://www.google.co.in/url?url=http://www.madinapolymer.com/e-
brochure/water-pump/&rct=j&frm=1&q=&esrc=s&sa=U&ved=0ahUKEwiq-
Mq04pXPAhUMuo8KHb8YDPYQwW4IOTAS&usg=AFQjCNE4yQmxIQnXEshDyN4MyYlLFFa6Jg">
<img alt="Image result for images of pumps" height="90"
src="https://encrypted-tbn0.gstatic.com/images?
q=tbn:ANd9GcQ3ulLLi0shVtpqu_dYjU9SW8b5lw3RaeOFggHA7I7tXGd105ef6B0O9Fcl"
width="128" /></a><br />
 
; &nbs
p; &nb
sp;
AR PUMPS<br />
 
; &nbs
p;
<br />
AR pumps are specially designed for industrial and agricultural uses. Its
impeller even pumps the dirty water.Compact,Simple and reliable to use.<br />
<br />
<br />
 
;
Lower the cost!!!<br />
 
; &nbs
p;
<br />
 
; &nbs
p;
Higher the perfection!!!
<br />
 
; &nbs
p; &nb
sp; &n
bsp; &
nbsp;
<a href="https://www.google.co.in/url?url=https://www.ksb.com/ksb-
en/Product_Types/centrifugal-
pump/&rct=j&frm=1&q=&esrc=s&sa=U&ved=0ahUKEwiq-
Mq04pXPAhUMuo8KHb8YDPYQwW4IKTAK&usg=AFQjCNG3qMHvEivNpMdcjBkcnM_oqbpZTg">
<img alt="Image result for images of pumps" height="89"
src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTD8pL1KBVZ7-
GblzMRRBrENfxgrvym1DoCei6oa9czFrRuzUGq-v62Xrk"
width="137" /></a><br />
 
; &nbs
p; &nb
sp; &n
bsp; &
nbsp;
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</form>
</body>
</html>
OUTPUT:-
14.STUDENT MARKS PROCESSING APPLICATION
AIM:
ALGORITHM:
Step 4: Open visual studio and select create project in windows application
Step 5: connect the database into the vb.net using data connection icon in
server explorer Microsoft access oledb connection
Step 6: Add textboxes, tables and buttons in the form type the necessary
coding to find the mark .
End Sub
End Sub
OUTPUT:-
15.EMPLOYEE PAYROLL SYSTEM
AIM:
ALGORITHM:
Step 4: Open visual studio and select create project in windows application
Step 5: connect the database using data connection icon in server explorer.
Microsoft access oledb connection
Step 6: Select and Drop the View Control from the Data Toolbox and change the
display as per the choice to detailview or Gridview.
Step7: Create one button for calculating the GROSSPAY, health allowance, tax and
netsalary. In Calculate button write the code for calculating the above things.
End Sub
End Sub
DeductionTextBox.Text = Val(_15__tax_of_monthly_wagesTextBox.Text) +
Val(Healthallowance_5_TextBox.Text)
NetsalaryTextBox.Text = Val(Gross_payTextBox.Text) - Val(DeductionTextBox.Text)
End Sub
End Class
FORM DESIGN:-
OUTPUT:-