This document provides examples of various Visual Basic applications using different controls. It includes 12 short applications demonstrating:
1. Label and text box controls to display input fields.
2. A calculator application using command buttons to perform arithmetic operations on two input numbers.
3. Radio buttons to display options and respond to user selection.
4. A form with text boxes, combo boxes and command buttons to accept user input.
5. A timer control changing the visibility of shapes to simulate traffic lights.
6. Getting user input on a form and displaying marks on another frame.
So in summary, it presents 12 mini-projects to demonstrate common Visual Basic controls and concepts like forms, buttons
Chapter 3 provides students with the skills and knowledge necessary to complete phases 2,3,and 4 of the PDLC by enhancing a GUI mock-up, designing program processing objects, and coding a program. Topics include using IntelliSense when writing code and enhancing a Visual Basic 2010 form by changing the BackColor property of an object and displaying images. This chapter also explains how to enter Visual Basic 2010 code, correct errors, and run a completed program. Finally, the chapter discusses the value of creating an event planning document.
Chapter 2 — Program and Graphical User Interface Designfrancopw
Chapter 2 introduces students to the major elements of the Visual Studio 2010 integrated development environment (IDE) while designing a graphical user interface mock-up. Topics include opening Visual Studio 2010, creating a Windows Forms Application project,adding objects to a Windows form, assigning properties to objects,aligning objects on the Windows form,and saving Visual Basic projects. The chapter also discusses how to apply GUI design principles and examines the first two phases of the program development life cycle (PDLC).
Chapter 3 provides students with the skills and knowledge necessary to complete phases 2,3,and 4 of the PDLC by enhancing a GUI mock-up, designing program processing objects, and coding a program. Topics include using IntelliSense when writing code and enhancing a Visual Basic 2010 form by changing the BackColor property of an object and displaying images. This chapter also explains how to enter Visual Basic 2010 code, correct errors, and run a completed program. Finally, the chapter discusses the value of creating an event planning document.
Chapter 2 — Program and Graphical User Interface Designfrancopw
Chapter 2 introduces students to the major elements of the Visual Studio 2010 integrated development environment (IDE) while designing a graphical user interface mock-up. Topics include opening Visual Studio 2010, creating a Windows Forms Application project,adding objects to a Windows form, assigning properties to objects,aligning objects on the Windows form,and saving Visual Basic projects. The chapter also discusses how to apply GUI design principles and examines the first two phases of the program development life cycle (PDLC).
Whether you are a senior manager, a project manager, a finance guy, a sales head, executive, marketing professional, operations or anyone who deals with numbers. We all need excel and we all have heard about MS Excel Macros. But most of us do not know how to write one or where to start from. This tutorial is a great starting point for quickly learning how to write your first Excel Macro so that you can get started on your own. So go ahead, check it out and have fun. Cheers.
Whether you are a senior manager, a project manager, a finance guy, a sales head, executive, marketing professional, operations or anyone who deals with numbers. We all need excel and we all have heard about MS Excel Macros. But most of us do not know how to write one or where to start from. This tutorial is a great starting point for quickly learning how to write your first Excel Macro so that you can get started on your own. So go ahead, check it out and have fun. Cheers.
Software engineering modeling lab lectures
engineering+ education purpose
This series of lectures was prepared for the third class of software engineering / Aliraqia University/ Baghdad/ Iraq.
In prepared these lectures, I depend on the YouTube to make it, the programs of the lectures are designed and executed by vb.net, discussions are also found here
These lectures are not finished yet, i will improve it in the future
Forgive me for anything wrong by mistake, I wish you can profit from these lectures
My regard
Marwa Moutaz/ M.Sc. studies of Communication Engineering / University of Technology/ Bagdad / Iraq.
PT1420: File Access and Visual Basic
Page 1
This lab examines how to work with a file by writing Visual Basic code. Read the following
programming problem prior to completing the lab.
Write and design a simple program that will take 3 pieces of data and write it to a file. Create
variables and set them equal to the appropriate values:
Declare string firstName = “xxx”
Declare string lastName = “xxx”
Declare integer age = your age
Write this information to a file called myRecords.txt. Next, read this information from
the file and print it to the screen.
Step 1: Create a new Visual Basic workspace and add the following code:
Module Module1
Sub Main()
Dim firstName As String = "XXXX"
Dim lastName As String = "XXX"
Dim age As Integer = ####
Dim writer As System.IO.StreamWriter = System.IO.File.CreateText("myRecords.txt")
writer.WriteLine(firstName & " " & lastName & " " & age)
writer.Close()
Dim reader As System.IO.StreamReader = System.IO.File.OpenText("myRecords.txt")
Dim myInfo As String = reader.ReadLine()
Console.WriteLine(myInfo)
PT1420: File Access and Visual Basic
Page 2
reader.Close()
'this causes a pause so you can see your program
Console.Write("Press enter to continue...")
Console.ReadLine()
End Sub
End Module
Your module looks like this:
PT1420: File Access and Visual Basic
Page 3
Step 2: Change the values of the variables to your records. Your module looks like this:
Step 3: Run your program so that it works properly. Your output might look as follows:
PT1420: File Access and Visual Basic
Page 4
Step 4: Locate the .txt file in the bin\debug folder, and view your .txt file. Your output might
look as follows:
PT1420: File Access and Visual Basic
Page 5
Step 5: Submit the Visual Basic code as a compressed (zipped) folder using the following steps:
a. Open Windows Explorer --> Start --> All Programs --> Accessories --> Windows Explorer.
Your Windows Explorer might look as follows:
...
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
2. INDEX
Sno Topic Page no
1 Introduction to VB 3
2 Tool Box 4
3 Property 5
4 Description -- Properties 6
5 Description -- Controls 7
6 Application 1: Showing labels and text boxes 8
7 Description -- Command button 9
8 Application 2: To Perform Arithmetic Operations on two numbers 10
9 Description – Controls 13
10 App 3 : Detail of any option click 14
11 App 4 : Application Form 17
12 Description -- control 20
13 App 5: Traffic lights 21
14 App 6: Getting marks of student and print result in another form 24
15 App 7: Moving the list item across two different lists 28
16 App 8: Formatting Text 31
17 App 9: with the help of menus perform Arithmetic operation 36
18 App 10: Print the series on form 39
19 App 11: Puzzle 41
20 App 12: Print table on the Form 47
21 App 13: Getting a string input from user and move it along border 49
2
3. Introduction to VB
Visual basic is an event driven programming. In event driven programming, the interface
components have the ability to recognize user events and then, if possible a response is given
to the event occurred. The response of identical interface components to an event can
different in different situations. In addition, an interface component may also respond to
multiple events.
In event driven programming an application is built up as a series of response to user event.
For instance, you may consider a calculator application, which is good example of an
application that is event driven.
Featues
• It is successor of BASIC language.
• VB supports event driven programming.
• Common Programming Platform VB provides a common programming platform
across all MS – Office applications.
• Quick Development VB offers many tools that provide a quick and easy way to
develop applications.
• Wizards VB also provides many wizards that can automate tasks or even automate
coding.
• Quick Error Detection /Correction The VB development environment provides
tools for quick editing, testing and debugging
3
4. Tool Box
The toolbox is a collection of tools that act as a repository of controls you can place on a
form.
4
5. Properties
Each property has a name so we can work with a particular property, and each property has a
value that either we or Visual Basic assigns. For example, Visual Basic always names the
first command button we add to a project Command1. Therefore, the Name property for the
first command button holds the value Command1
5
6. Property Description
Alignment : Determines whether text on the control, such as a label or
command button, is left-justified, centered, or right-justified on
the control.
BackColor : Specifies the color of the control's background, which you
select from a palette of colors when you open the property drop-
down list box of colors.
BorderStyle : Determines whether the control has a border around it.
Caption : Lists the text displayed on the control.
Enabled : Set by a drop-down list box, this property is either True if we
want the control to respond to the user or False if we want
the control not to respond to the user.
Font : Displays a Font dialog box from which you can set various font
properties, such as size and style, for a control's text.
ForeColor : Specifies the color of the control's foreground, which you select
from a palette of colors when we open the property's drop-down
list box of colors.
Height : Specifies the number of twips high the control is.
Left : Indicates the starting twip from the left edge of the form where
the control appears.
Mouse Pointer : Determines the shape of the mouse cursor when the user
moves the mouse over the control at runtime.
Name : Specifies the name of the control. As you saw in yesterday's
lesson, the Properties window displays the .
Tooltip Text : Holds the text that appears when the user rests the mouse
Cursor over the control at runtime (similar to ScreenTips).
6
7. CONTROLS
1. Selection Pointer
Selection pointer is used to select the pointer control from the tool box.
2. Label
The label control displays text. Although your user cannot alter the text that
appears on a label, you can, at runtime, change the label's text through code.
3. The Text Box Control
Use a text box control when we want the user to type something, such
as an answer to a prompt, when we want to collect values, such as
name and address information. Often, a default value is helpful for
users, and Visual Basic program can supply an initial value.
7
8. Application 1
NOTE : Here no coding will be done because we are simply putting the label,
text box controls on the form so, there output will be like the above program .
8
Labels
9. 4. Command Button
Command button is used to perform some kind of
operations although other controls can also perform.
This button is used to begin, interrupt or end a process.
9
10. Application 2:
WAP to add, subtract, multiply and divide two numbers?
Step 1:
Create a form
10
11. Step 2:
Start the coding
Private Sub cmd_Click()
Me.sum.Text = Val(txtnum1.Text) + Val(txtnum2.Text)
Me.sub.Text = Val(txtnum1.Text) - Val(txtnum2.Text)
Me.mul.Text = Val(txtnum1.Text) * Val(txtnum2.Text)
Me.div.Text = Val(txtnum1.Text) / Val(txtnum2.Text)
End Sub
Private Sub Form_Load()
MsgBox (" Hello Welcome to perform operations")
End Sub
11
13. 5. Check Box
Check boxes are used to allow a user select multiple choices.
For example a student can choose any five subjects out of
available 7 subjects. Now the subject chosen the 5 subject
he/she wants to choose they can.
6. Option Box
An option button also known as radio button is used to display
an option that can be turned on or off. Usually option buttons
are used for a group of options wherefrom user can select just
one.
For example a student can have option for choosing the
medium either Hindi or English so the student has to choose the
one option.
7. Frames
A frame control is used to separate different group of
controls on form.
8. Combo Box
A combo box control combines the feature of a text box and a
list box.
9. List Box
A list box control display a list of item from which the user can
select one or more items
13
15. Step 2:
Coding
private Sub Command1_Click()
If Option1.Value = True Then
MsgBox (" An input device used to type and enter data")
ElseIf Option2.Value = True Then
MsgBox (" An input device used for clicking various things")
ElseIf Option3.Value = True Then
MsgBox (" An output device used to display data")
ElseIf Option4.Value = True Then
MsgBox (" An output device used to print data")
End If
End Sub
15
18. Step 2
Private Sub Command1_Click()
MsgBox (txtname.Text & Cmbqual.Text & ",your data has been submited")
End Sub
Private Sub Command2_Click()
txtname.Text = ""
Me.Option1.Value = True
Cmbqual.Text = "B.A"
chkmusic.Value = False
chkpaint.Value = False
chkread.Value = False
End Sub
18
20. 10. Timer:
The timer control is an invisible control which is added to form
if some task is to be repeated regular intervals
11.Shapes
The shape control is a graphical control that is used to display a
rectangle, oval, circle or rounded square.
20
29. Coding
Private Sub cmdexit_Click()
End
End Sub
Private Sub Command1_Click()
List2.AddItem (List1.Text)
List1.RemoveItem (List1.ListIndex)
End Sub
Private Sub Command2_Click()
List1.AddItem (List2.Text)
List2.RemoveItem (List2.ListIndex)
End Sub
29
32. Coding
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text1.FontBold = True
Else
Text1.FontBold = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
Text1.FontItalic = True
Else
Text1.FontItalic = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
Text1.FontUnderline = True
Else
Text1.FontUnderline = False
End If
End Sub
Private Sub Combo1_Click()
If Combo1.ListIndex = 0 Then
Text1.FontSize = Combo1.Text
ElseIf Combo1.ListIndex = 1 Then
Text1.FontSize = Combo1.Text
ElseIf Combo1.ListIndex = 2 Then
Text1.FontSize = Combo1.Text
ElseIf Combo1.ListIndex = 3 Then
32
33. Text1.FontSize = Combo1.Text
End If
End Sub
Private Sub Combo2_click()
If Combo2.ListIndex = 0 Then
Text1.FontName = Combo2.Text
ElseIf Combo2.ListIndex = 1 Then
Text1.FontName = Combo2.Text
ElseIf Combo2.ListIndex = 2 Then
Text1.FontName = Combo2.Text
ElseIf Combo2.ListIndex = 3 Then
Text1.FontName = Combo2.Text
End If
End Sub
Private Sub Form_Load()
Combo2.AddItem "Times New Roman"
Combo2.AddItem "Arial"
Combo2.AddItem "Shruti"
Combo2.AddItem "Monotype Corsiva"
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
Text1.BackColor = vbCyan
End If
End Sub
33
34. Private Sub Option2_Click()
If Option2.Value = True Then
Text1.BackColor = vbBlack
End If
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then
Text1.BackColor = vbYellow
End If
End Sub
34
37. Coding
Private Sub add_Click()
Me.answ.Text = Val(txtnum1.Text) + Val(txtnum2.Text)
End Sub
Private Sub divi_Click()
Me.answ.Text = Val(txtnum1.Text) / Val(txtnum2.Text)
End Sub
Private Sub min_Click()
Me.answ.Text = Val(txtnum1.Text) - Val(txtnum2.Text)
End Sub
Private Sub mult_Click()
Me.answ.Text = Val(txtnum1.Text) * Val(txtnum2.Text)
End Sub
37
39. Application 10
To print the series
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Coding
Private Sub Form_Click()
For r = 1 To 5
For c = 1 To r
Print c;
Next
Print
Next
End Sub
39
42. Coding
Private Sub Command1_Click()
If Command2.Caption = "" Then
Command2.Caption = Command1.Caption
Command1.Caption = ""
ElseIf Command4.Caption = "" Then
Command4.Caption = Command1.Caption
Command1.Caption = ""
End If
End Sub
Private Sub Command2_Click()
If Command1.Caption = "" Then
Command1.Caption = Command2.Caption
Command2.Caption = ""
ElseIf Command3.Caption = "" Then
Command3.Caption = Command2.Caption
Command2.Caption = ""
ElseIf Command5.Caption = "" Then
Command5.Caption = Command2.Caption
Command2.Caption = ""
End If
End Sub
Private Sub Command3_Click()
If Command2.Caption = "" Then
Command2.Caption = Command3.Caption
Command3.Caption = ""
ElseIf Command6.Caption = "" Then
Command6.Caption = Command3.Caption
Command3.Caption = ""
End If
End Sub
42
43. Private Sub Command4_Click()
If Command1.Caption = "" Then
Command1.Caption = Command4.Caption
Command4.Caption = ""
ElseIf Command5.Caption = "" Then
Command5.Caption = Command4.Caption
Command4.Caption = ""
ElseIf Command7.Caption = "" Then
Command7.Caption = Command4.Caption
Command4.Caption = ""
End If
End Sub
Private Sub Command5_Click()
If Command2.Caption = "" Then
Command2.Caption = Command5.Caption
Command5.Caption = ""
ElseIf Command4.Caption = "" Then
Command4.Caption = Command5.Caption
Command5.Caption = ""
ElseIf Command6.Caption = "" Then
Command6.Caption = Command5.Caption
Command5.Caption = ""
ElseIf Command8.Caption = "" Then
Command8.Caption = Command5.Caption
Command5.Caption = ""
End If
End Sub
Private Sub Command6_Click()
If Command3.Caption = "" Then
Command3.Caption = Command6.Caption
Command6.Caption = ""
43
44. ElseIf Command5.Caption = "" Then
Command5.Caption = Command6.Caption
Command6.Caption = ""
ElseIf Command9.Caption = "" Then
Command9.Caption = Command6.Caption
Command6.Caption = ""
End If
End Sub
Private Sub Command7_Click()
If Command4.Caption = "" Then
Command4.Caption = Command7.Caption
Command7.Caption = ""
ElseIf Command8.Caption = "" Then
Command8.Caption = Command7.Caption
Command7.Caption = ""
End If
End Sub
Private Sub Command8_Click()
If Command5.Caption = "" Then
Command5.Caption = Command8.Caption
Command8.Caption = ""
ElseIf Command7.Caption = "" Then
Command7.Caption = Command8.Caption
Command8.Caption = ""
ElseIf Command9.Caption = "" Then
Command9.Caption = Command8.Caption
Command8.Caption = ""
End If
End Sub
44
45. Private Sub Command9_Click()
If Command6.Caption = "" Then
Command6.Caption = Command9.Caption
Command9.Caption = ""
ElseIf Command8.Caption = "" Then
Command8.Caption = Command9.Caption
Command9.Caption = ""
End If
End Sub
Execute
45
50. Coding
Private Sub cmdstart_Click()
Me.Label1.Caption = Me.Text1.Text
Me.Timer1.Enabled = True
End Sub
Private Sub cmdstop_Click()
Me.Timer1.Enabled = False
Me.Timer2.Enabled = False
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub Form_Load()
Me.Timer1.Enabled = False
Me.Label1.Left = 0
End Sub
Private Sub Text1_Click()
Me.Text1.Text = ""
Me.Text1.SetFocus
End Sub
Private Sub Timer1_Timer()
If Me.Label1.Left <= 6600 Then
Me.Label1.Left = Me.Label1.Left + 10
ElseIf Me.Label1.Top <= 6600 Then
Me.Label1.Top = Me.Label1.Top + 10
Else
Timer1.Enabled = False
50
51. Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
If Me.Label1.Left >= 0 Then
Me.Label1.Left = Me.Label1.Left - 10
ElseIf Me.Label1.Top >= 0 Then
Me.Label1.Top = Me.Label1.Top - 10
Else
Timer1.Enabled = True
Timer2.Enabled = False
End If
End Sub
51