SlideShare a Scribd company logo
Windows form application in
VB.NET
Open new project
Form1
Adding controls
Adding event handler
Run the application
Application 1: Design the form as given
below
Enter following code
• Public Class Form1
• Dim Add As Boolean
• Dim value1, value2 As Double
• Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
• End Sub
• Private Sub Button4_Click(sender As Object, e As EventArgs) Handles sum.Click
• value1 = Double.Parse(TextBox1.Text)
• Add = True
• TextBox1.Clear()
• End Sub
• Private Sub Button1_Click(sender As Object, e As EventArgs) Handles one.Click
• TextBox1.Text = TextBox1.Text & 1
• End Sub
Cont..
• Private Sub Button2_Click(sender As Object, e As EventArgs) Handles two.Click
• TextBox1.Text = TextBox1.Text & 2
• End Sub
• Private Sub Button3_Click(sender As Object, e As EventArgs) Handles three.Click
• TextBox1.Text = TextBox1.Text & 3
• End Sub
• Private Sub Button6_Click(sender As Object, e As EventArgs) Handles cleart.Click
• TextBox1.Clear()
• End Sub
• Private Sub Button5_Click(sender As Object, e As EventArgs) Handles eq.Click
• value2 = Double.Parse(TextBox1.Text)
• If Add = True Then
• TextBox1.Text = value1 + value2 & "" 'Val1 & val2 are doubles, as textbox supports string we
need to convert val1+val2 to string so we have just added "" to convert it into a string
• Add = False
• End If
• End Sub
• End Class
Run the application
Adding controls at run time:Open new
form
Adding controls at run time: Double
click on the form1 and write the
following code
• Public Class Form1
• Private t1 As New TextBox
• Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
• t1.Location = New Point(10, 20)
• t1.Size = New System.Drawing.Size(150, 250)
• t1.Text = "hello"
• Controls.Add(t1)
• End Sub
• End Class
Run the application
Form1
Adding a button at runtime
• Public Class Form1
• Dim btn1 As New Button()
• Dim t1 As New TextBox
• Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
• ' creating control
• t1.Location = New Point(30, 40)
• t1.Size = New System.Drawing.Size(100, 100)
• t1.Text = ""
• btn1.Name = "btn1"
• btn1.Top = 10
• btn1.Text = "Btn1"
• Controls.Add(t1)
• Controls.Add(btn1)
• 'adding handler for click event
• AddHandler btn1.Click, AddressOf show1
• End Sub
• Private Sub show1(ByVal sender As Object, ByVal e As EventArgs)
• t1.Text = "hello"
• End Sub
•
• End Class
Cont..
Problem 1: The form should appear as
shown below
Menu
Creating a menu
Cont..
Run the Application
Cont..
Working with Multiform
Creating second form
Run the Application
Reading data from one form to
another:Form1
Creating form2
Code for the form1
Code for the form2
Run the application
Form Inheritance: Derived form
Base form
Double click on the form1:Derived
form
Run the application
Tab control
Add forth tab:code
Run the application:Use control
key+tab to switch between tabs
Changing the startup form
Open project menu
Change the startup form
Run the application
Anchor property in vb.net: Changing
position of the control
Run the application
List view
Cont..
Cont..
cont..
To remove item
Cont..
Creating User control
Open project
Cont..
Cont..
Drag and drop a text box from the
toolbox to the mycontrol1
Build solution and open the form in design view: Your
control will appear on the top of the toolbox
Now drag and drop the control from
the toolbox to the form
Example 1
Code for the property
• Public Class Student_info
• Dim msg As String
• Property text1() As String
• Get
• Return msg
• End Get
• Set(value As String)
• msg = value
• End Set
• End Property
• Private Sub Student_info_Load(sender As Object, e As EventArgs)
Handles MyBase.Load
• TextBox1.Text = text1
• End Sub
• End Class
Run the application
The TreeView Control
• A TreeView control displays a hierarchy of
nodes, which may include child nodes.
Windows Explorer, which uses a tree view in
its left pane to display the hierarchy of folders
stored on the hard disk of a computer, is an
example of the implementation of the
TreeView control. Figure shows a TreeView
control
Tree view
Cont..
• A TreeView control can also display the hierarchy of nodes with
checkboxes placed next to the nodes of the tree structure if the
TreeView’s CheckBoxes property is set to True.
• You can then check or uncheck the nodes to select or deselect them
by setting the node’s Checked property to True or False.
• The main properties of tree views are Nodes and SelectedNode.
The Nodes property contains a list of nodes in the tree view, and
the SelectedNode property specifies the currently selected node.
• Nodes themselves are supported by the TreeNode class. A node
can be a parent of other child nodes, called TreeNode objects. You
can add, remove, or clone a TreeNode object, which in turn can also
contain a collection of other TreeNode objects. The FullPath
property specifies the nodes in terms of their absolute locations.
You can add nodes to a TreeView control through the Nodes property. The
Nodes property in the Properties window enables you to open the TreeNode
Editor dialog box, as shown in Figure
Tree view control form
Cont..
• An alternative to display the checkboxes beside the nodes in a TreeView
control is shown in the following code
• snippet:
• private void button1_Click(object sender, EventArgs e)
• {
• treeView1.CheckBoxes = true;
• }
The ImageList Control
• An ImageList control is used to store images; i.e., it acts as a kind of image
repository. Various controls are used to work with an ImageList control,
such as list views, tree views, toolbars, tab controls, checkboxes, buttons,
radio buttons, and labels.
• You can associate an ImageList control with its ImageList property and
specify the images you want to display in the control by using the
ImageIndex property. The images in an ImageList control are indexed—
starting at zero—and you can switch the image displayed in a control at
runtime by changing the value of the ImageIndex property.
• The main property in the ImageList control is Images, which contains the
images to be used by the control. The ColorDepth property of the
ImageList control determines the number of colors with which an image is
rendered. Note that images are displayed in the size set by the ImageSize
property. This property is set to 16×16 pixels by default (the size of a small
icon) and needs to be changed when the images are loaded into an
• image list.
Properties of image list
Cont..
Cont..
• To add an image list to the ImageList control,
you should use the Images property in the
Properties window.
• The Images property enables you to open the
Images Collection Editor dialog box, as shown
in Figure
Example 1
Cont..
Run the Application
Example 2
Cont..
Run the application
Image property
Cont..
• you can see the Add and Remove buttons
used to add or delete an image to an
ImageList control.
• You can resize the images in the ImageList (the
default is 16×16 pixels, the size of a small icon)
control by using the ImageSize property in the
Properties window.

More Related Content

What's hot

Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
prabhu rajendran
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Event handling
Event handlingEvent handling
Event handling
swapnac12
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
MUKALU STEVEN
 
Java swing
Java swingJava swing
Java swing
Apurbo Datta
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
Ranjuma Shubhangi
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
Tareq Hasan
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
shanmuga rajan
 
VB net lab.pdf
VB net lab.pdfVB net lab.pdf
VB net lab.pdf
Prof. Dr. K. Adisesha
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
Jaya Kumari
 
Visual basic
Visual basicVisual basic
Visual basic
umesh patil
 
Exception Handling in VB.Net
Exception Handling in VB.NetException Handling in VB.Net
Exception Handling in VB.Net
rishisingh190
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
Anjan Mahanta
 
Java package
Java packageJava package
Java package
CS_GDRCST
 
Visual basic
Visual basicVisual basic
Visual basic
KavithaAlagumalai
 
Java Notes
Java NotesJava Notes
Java Notes
Abhishek Khune
 

What's hot (20)

Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
4.C#
4.C#4.C#
4.C#
 
Event handling
Event handlingEvent handling
Event handling
 
Active x control
Active x controlActive x control
Active x control
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
 
Java swing
Java swingJava swing
Java swing
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
VB net lab.pdf
VB net lab.pdfVB net lab.pdf
VB net lab.pdf
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
 
Visual basic
Visual basicVisual basic
Visual basic
 
Exception Handling in VB.Net
Exception Handling in VB.NetException Handling in VB.Net
Exception Handling in VB.Net
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
 
Java package
Java packageJava package
Java package
 
Visual basic
Visual basicVisual basic
Visual basic
 
Java Notes
Java NotesJava Notes
Java Notes
 

Similar to Windows form application_in_vb(vb.net --3 year)

Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
KavithaAlagumalai
 
Visual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th classVisual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th class
mnewg218
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
Aparna Reddy
 
Maliram poonia project
Maliram poonia projectMaliram poonia project
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Ujwala Junghare
 
Illustrator assignment 1
Illustrator assignment 1Illustrator assignment 1
Illustrator assignment 1rgosselin
 
Illustrator assignment 1
Illustrator assignment 1Illustrator assignment 1
Illustrator assignment 1rgosselin
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
sheenmarie0212
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
Andi Simanjuntak
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Salim M
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls objectallenbailey
 
TrackBar and TreeView
TrackBar and TreeViewTrackBar and TreeView
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15
Rajes Wari
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
AdiseshaK
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
Prof. Dr. K. Adisesha
 
JAVA Programming: Topic -AWT(Abstract Window Tool )
JAVA Programming: Topic -AWT(Abstract Window Tool )JAVA Programming: Topic -AWT(Abstract Window Tool )
JAVA Programming: Topic -AWT(Abstract Window Tool )
Navya Francis
 
Gui programming
Gui programmingGui programming
Gui programming
manikanta361
 

Similar to Windows form application_in_vb(vb.net --3 year) (20)

Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Treeview listview
Treeview listviewTreeview listview
Treeview listview
 
Visual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th classVisual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th class
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
 
Unit2
Unit2Unit2
Unit2
 
Maliram poonia project
Maliram poonia projectMaliram poonia project
Maliram poonia project
 
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
 
Illustrator assignment 1
Illustrator assignment 1Illustrator assignment 1
Illustrator assignment 1
 
Illustrator assignment 1
Illustrator assignment 1Illustrator assignment 1
Illustrator assignment 1
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls object
 
TrackBar and TreeView
TrackBar and TreeViewTrackBar and TreeView
TrackBar and TreeView
 
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
 
JAVA Programming: Topic -AWT(Abstract Window Tool )
JAVA Programming: Topic -AWT(Abstract Window Tool )JAVA Programming: Topic -AWT(Abstract Window Tool )
JAVA Programming: Topic -AWT(Abstract Window Tool )
 
Gui programming
Gui programmingGui programming
Gui programming
 

More from Ankit Gupta

Biometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learningBiometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learning
Ankit Gupta
 
Week2 cloud computing week2
Week2 cloud computing week2Week2 cloud computing week2
Week2 cloud computing week2
Ankit Gupta
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture material
Ankit Gupta
 
Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Week 4 lecture material cc (1)
Week 4 lecture material cc (1)
Ankit Gupta
 
Week 3 lecture material cc
Week 3 lecture material ccWeek 3 lecture material cc
Week 3 lecture material cc
Ankit Gupta
 
Week 1 lecture material cc
Week 1 lecture material ccWeek 1 lecture material cc
Week 1 lecture material cc
Ankit Gupta
 
Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)
Ankit Gupta
 
Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)
Ankit Gupta
 
Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)
Ankit Gupta
 
Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)
Ankit Gupta
 
Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)
Ankit Gupta
 
Lecture29 cc-security4
Lecture29 cc-security4Lecture29 cc-security4
Lecture29 cc-security4
Ankit Gupta
 
Lecture28 cc-security3
Lecture28 cc-security3Lecture28 cc-security3
Lecture28 cc-security3
Ankit Gupta
 
Lecture27 cc-security2
Lecture27 cc-security2Lecture27 cc-security2
Lecture27 cc-security2
Ankit Gupta
 
Lecture26 cc-security1
Lecture26 cc-security1Lecture26 cc-security1
Lecture26 cc-security1
Ankit Gupta
 
Lecture 30 cloud mktplace
Lecture 30 cloud mktplaceLecture 30 cloud mktplace
Lecture 30 cloud mktplace
Ankit Gupta
 
Week 7 lecture material
Week 7 lecture materialWeek 7 lecture material
Week 7 lecture material
Ankit Gupta
 
Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16
Ankit Gupta
 
Microprocessor full hand made notes
Microprocessor full hand made notesMicroprocessor full hand made notes
Microprocessor full hand made notes
Ankit Gupta
 
Transfer Leaning Using Pytorch synopsis Minor project pptx
Transfer Leaning Using Pytorch  synopsis Minor project pptxTransfer Leaning Using Pytorch  synopsis Minor project pptx
Transfer Leaning Using Pytorch synopsis Minor project pptx
Ankit Gupta
 

More from Ankit Gupta (20)

Biometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learningBiometricstechnology in iot and machine learning
Biometricstechnology in iot and machine learning
 
Week2 cloud computing week2
Week2 cloud computing week2Week2 cloud computing week2
Week2 cloud computing week2
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture material
 
Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Week 4 lecture material cc (1)
Week 4 lecture material cc (1)
 
Week 3 lecture material cc
Week 3 lecture material ccWeek 3 lecture material cc
Week 3 lecture material cc
 
Week 1 lecture material cc
Week 1 lecture material ccWeek 1 lecture material cc
Week 1 lecture material cc
 
Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)Mod05lec25(resource mgmt ii)
Mod05lec25(resource mgmt ii)
 
Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)
 
Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)Mod05lec23(map reduce tutorial)
Mod05lec23(map reduce tutorial)
 
Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)Mod05lec22(cloudonomics tutorial)
Mod05lec22(cloudonomics tutorial)
 
Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)Mod05lec21(sla tutorial)
Mod05lec21(sla tutorial)
 
Lecture29 cc-security4
Lecture29 cc-security4Lecture29 cc-security4
Lecture29 cc-security4
 
Lecture28 cc-security3
Lecture28 cc-security3Lecture28 cc-security3
Lecture28 cc-security3
 
Lecture27 cc-security2
Lecture27 cc-security2Lecture27 cc-security2
Lecture27 cc-security2
 
Lecture26 cc-security1
Lecture26 cc-security1Lecture26 cc-security1
Lecture26 cc-security1
 
Lecture 30 cloud mktplace
Lecture 30 cloud mktplaceLecture 30 cloud mktplace
Lecture 30 cloud mktplace
 
Week 7 lecture material
Week 7 lecture materialWeek 7 lecture material
Week 7 lecture material
 
Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16Gurukul Cse cbcs-2015-16
Gurukul Cse cbcs-2015-16
 
Microprocessor full hand made notes
Microprocessor full hand made notesMicroprocessor full hand made notes
Microprocessor full hand made notes
 
Transfer Leaning Using Pytorch synopsis Minor project pptx
Transfer Leaning Using Pytorch  synopsis Minor project pptxTransfer Leaning Using Pytorch  synopsis Minor project pptx
Transfer Leaning Using Pytorch synopsis Minor project pptx
 

Recently uploaded

Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 

Recently uploaded (20)

Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 

Windows form application_in_vb(vb.net --3 year)

  • 7. Application 1: Design the form as given below
  • 8. Enter following code • Public Class Form1 • Dim Add As Boolean • Dim value1, value2 As Double • Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load • End Sub • Private Sub Button4_Click(sender As Object, e As EventArgs) Handles sum.Click • value1 = Double.Parse(TextBox1.Text) • Add = True • TextBox1.Clear() • End Sub • Private Sub Button1_Click(sender As Object, e As EventArgs) Handles one.Click • TextBox1.Text = TextBox1.Text & 1 • End Sub
  • 9. Cont.. • Private Sub Button2_Click(sender As Object, e As EventArgs) Handles two.Click • TextBox1.Text = TextBox1.Text & 2 • End Sub • Private Sub Button3_Click(sender As Object, e As EventArgs) Handles three.Click • TextBox1.Text = TextBox1.Text & 3 • End Sub • Private Sub Button6_Click(sender As Object, e As EventArgs) Handles cleart.Click • TextBox1.Clear() • End Sub • Private Sub Button5_Click(sender As Object, e As EventArgs) Handles eq.Click • value2 = Double.Parse(TextBox1.Text) • If Add = True Then • TextBox1.Text = value1 + value2 & "" 'Val1 & val2 are doubles, as textbox supports string we need to convert val1+val2 to string so we have just added "" to convert it into a string • Add = False • End If • End Sub • End Class
  • 11. Adding controls at run time:Open new form
  • 12. Adding controls at run time: Double click on the form1 and write the following code • Public Class Form1 • Private t1 As New TextBox • Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load • t1.Location = New Point(10, 20) • t1.Size = New System.Drawing.Size(150, 250) • t1.Text = "hello" • Controls.Add(t1) • End Sub • End Class
  • 14. Form1
  • 15. Adding a button at runtime • Public Class Form1 • Dim btn1 As New Button() • Dim t1 As New TextBox • Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load • ' creating control • t1.Location = New Point(30, 40) • t1.Size = New System.Drawing.Size(100, 100) • t1.Text = "" • btn1.Name = "btn1" • btn1.Top = 10 • btn1.Text = "Btn1" • Controls.Add(t1) • Controls.Add(btn1) • 'adding handler for click event • AddHandler btn1.Click, AddressOf show1 • End Sub • Private Sub show1(ByVal sender As Object, ByVal e As EventArgs) • t1.Text = "hello" • End Sub • • End Class
  • 17. Problem 1: The form should appear as shown below
  • 18. Menu
  • 26. Reading data from one form to another:Form1
  • 28. Code for the form1
  • 29. Code for the form2
  • 33. Double click on the form1:Derived form
  • 37. Run the application:Use control key+tab to switch between tabs
  • 42. Anchor property in vb.net: Changing position of the control
  • 54. Drag and drop a text box from the toolbox to the mycontrol1
  • 55. Build solution and open the form in design view: Your control will appear on the top of the toolbox
  • 56. Now drag and drop the control from the toolbox to the form
  • 58. Code for the property • Public Class Student_info • Dim msg As String • Property text1() As String • Get • Return msg • End Get • Set(value As String) • msg = value • End Set • End Property • Private Sub Student_info_Load(sender As Object, e As EventArgs) Handles MyBase.Load • TextBox1.Text = text1 • End Sub • End Class
  • 60. The TreeView Control • A TreeView control displays a hierarchy of nodes, which may include child nodes. Windows Explorer, which uses a tree view in its left pane to display the hierarchy of folders stored on the hard disk of a computer, is an example of the implementation of the TreeView control. Figure shows a TreeView control
  • 62. Cont.. • A TreeView control can also display the hierarchy of nodes with checkboxes placed next to the nodes of the tree structure if the TreeView’s CheckBoxes property is set to True. • You can then check or uncheck the nodes to select or deselect them by setting the node’s Checked property to True or False. • The main properties of tree views are Nodes and SelectedNode. The Nodes property contains a list of nodes in the tree view, and the SelectedNode property specifies the currently selected node. • Nodes themselves are supported by the TreeNode class. A node can be a parent of other child nodes, called TreeNode objects. You can add, remove, or clone a TreeNode object, which in turn can also contain a collection of other TreeNode objects. The FullPath property specifies the nodes in terms of their absolute locations.
  • 63. You can add nodes to a TreeView control through the Nodes property. The Nodes property in the Properties window enables you to open the TreeNode Editor dialog box, as shown in Figure
  • 65. Cont.. • An alternative to display the checkboxes beside the nodes in a TreeView control is shown in the following code • snippet: • private void button1_Click(object sender, EventArgs e) • { • treeView1.CheckBoxes = true; • }
  • 66. The ImageList Control • An ImageList control is used to store images; i.e., it acts as a kind of image repository. Various controls are used to work with an ImageList control, such as list views, tree views, toolbars, tab controls, checkboxes, buttons, radio buttons, and labels. • You can associate an ImageList control with its ImageList property and specify the images you want to display in the control by using the ImageIndex property. The images in an ImageList control are indexed— starting at zero—and you can switch the image displayed in a control at runtime by changing the value of the ImageIndex property. • The main property in the ImageList control is Images, which contains the images to be used by the control. The ColorDepth property of the ImageList control determines the number of colors with which an image is rendered. Note that images are displayed in the size set by the ImageSize property. This property is set to 16×16 pixels by default (the size of a small icon) and needs to be changed when the images are loaded into an • image list.
  • 69. Cont.. • To add an image list to the ImageList control, you should use the Images property in the Properties window. • The Images property enables you to open the Images Collection Editor dialog box, as shown in Figure
  • 77. Cont.. • you can see the Add and Remove buttons used to add or delete an image to an ImageList control. • You can resize the images in the ImageList (the default is 16×16 pixels, the size of a small icon) control by using the ImageSize property in the Properties window.