SlideShare a Scribd company logo
Introduction
The Windows-based application you are going to construct is Lucky Seven, a game program that
simulates a lucky number slot machine. Lucky seven has a simple user interface and can be created
and compiled in just a few minutes using Microsoft Visual Basic. Here’s what your program will
look like when it’s finished:

Objective:
After completing this Unit, you will be able to:
1. Create the user interface for a new program.
2. Set the properties for each object in your user interface.
3. Write program code.
4. Save and run the program.
5. Build an executable file.
The process:

Programming Steps
Programming Steps

Number of Items

1. Create the user interface

7 objects

2. Set the properties

13 properties

3. Write the program code

2 objects

Creating the User Interface:

In this exercise, you will start building Lucky Seven by first creating a new project and then
using controls in the Toolbox to construct the user interface.
. Create a new project
1. On the Visual Studio File menu, click New Project.
2. Click the Windows Forms Application icon in the central Templates area of the dialog box.
3. In the Name text box, type MyLucky7. Click OK.
Do these first steps to open the program and work on it.


Create the user interface
1. Click the Toolbox tab to display the Toolbox window in the IDE
2. Double-click the Button control in the Toolbox, and then move the mouse pointer away from the
Toolbox
3. Move & resize the button
4. Repeat the steps for adding more button, four labels, and one picture box.
The numbers and types of controls are written above in the picture. That will
don after clicking in toolbox.

Arrange the form like this form in the picture below.

. You can set the properties by using this properties box as you see in the
picture below.
So these properties you should set it of the control which are created in the
form.

The Picture Box Properties
1. Click the picture box object on the form
2. Click the SizeMode property in the Properties window, and then click StretchImage
3. Click the Image property in the Properties window, and then click the ellipsis button in the second
column.
4. Click the Local Resource radio button, and then click the Import button.
5. In the Open dialog box, navigate to the folder that contains the digital photo PayCoins.jpg.
6. Select PayCoins.jpg, and then click Open
7. Click the Visible property in the Behavior category of the Properties window, and then click the
arrow in the second column.
8. Click False to make the picture invisible when the program starts.
9. Set the properties of other controls so that they appear as in the screen shoot above.

Object
Button1
Button2
Label1, Label2, Label3

Label4

Property
Text
Text
Auto Size
Border Style
Font
Text
Text Align
Text
Font
For Color

Setting
Spin
End
False
Fixed Single
Times New Roman, Bold, 24-point
“0”
Middle Center
Lucky Seven”
Arial, Bold, 18-point
Purple

Writing the Code


Use the Code Editor

When you double click at the control you will see this form come out.
1. Double-click the End button on the form

Inside the Code Editor are program statements associated with the current form. Program
statements that are used together to perform some action are typically grouped in a
programming construct called a procedure. A common type of procedure is a Sub
procedure. Sub procedures include a Sub keyword in the first line and end with End Sub.
Procedures are typically executed when certain events occur, such as when a button is
clicked. When a procedure is associated with a particular object and an event, it is called
an event handler. When you double-clicked the End button (Button2), Visual Studio
automatically added the first and last lines of the Button2_Click event procedure.
2. Type End, and then press the ENTER key
Write code for the Spin button
1. Double-click the Spin button.
2. Type the following program lines between the Private Sub and End Sub statements:
PictureBox1.Visible = False ' hide picture
Label1.Text = CStr(Int(Rnd() * 10)) ' pick numbers
Label2.Text = CStr(Int(Rnd() * 10))
Label3.Text = CStr(Int(Rnd() * 10))
' if any number is 7 display picture and beep
If (Label1.Text = "7") Or (Label2.Text = "7") Or (Label3.Text = "7") Then
PictureBox1.Visible = True
Beep()
End If

3. Click the Save All command on the File menu to save your additions to the program
Running Visual Basic Applications
* Run the Lucky Seven program
1. Click the Start Debugging button on the Standard toolbar. The Lucky Seven program compiles and
runs in the IDE. After a few seconds, the user interface appears, just as you designed it.
2. Click the Spin button. The program picks three random numbers and displays them in the labels on
the form, as follows:



Adding to a Program
1. Double-click the form to display the Form_Load procedure. The Form_Load procedure
appears in the Code Editor.
2. Type Randomize, and then press ENTER

The Randomize statement is added to the program and will be executed each time the
program starts. Randomize uses the system clock to create a truly random starting point,
or seed, for the Rnd statement used in the Button1_Click procedure.
3. Run the new version of Lucky Seven, and then save the project.

Activities

1. Use visual basic program and create your own game by the
program.
Materials:
Text: An Introduction to Visual Basic 2010, Schneider, Prentice Hall ISBN-13: 978-0-13212856-8
You will also need a thumb drive or other memory device and a loose-leaf binder for the
handouts, online materials, and printouts of the programs.
Software: Visual Studio Express is free and can be downloaded from
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express
Introduction

More Related Content

What's hot

Visual studio ide componects dot net framwork
Visual studio ide componects dot net framworkVisual studio ide componects dot net framwork
Visual studio ide componects dot net framwork
Dipen Parmar
 
Using Applications in Windows - R.D.Sivakumar
Using Applications in Windows - R.D.SivakumarUsing Applications in Windows - R.D.Sivakumar
Using Applications in Windows - R.D.Sivakumar
Sivakumar R D .
 
Spf chapter10 events
Spf chapter10 eventsSpf chapter10 events
Spf chapter10 events
Hock Leng PUAH
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menu
kuldeep94
 
How to Fix Windows 8 Crashes
How to Fix Windows 8 CrashesHow to Fix Windows 8 Crashes
How to Fix Windows 8 Crashes
Vikas Medhekar
 
02 getting start with android app development
02 getting start with android app development02 getting start with android app development
02 getting start with android app development
Sokngim Sa
 
Lecture 3 INTRODUCTION TO COMPUTER
Lecture 3 INTRODUCTION TO COMPUTERLecture 3 INTRODUCTION TO COMPUTER
Lecture 3 INTRODUCTION TO COMPUTER
Sultan Omar Shige
 
IDS FortuneNext 6i Property Management: Hot keys and keyboard short cuts
IDS FortuneNext 6i Property Management: Hot keys and keyboard short cutsIDS FortuneNext 6i Property Management: Hot keys and keyboard short cuts
IDS FortuneNext 6i Property Management: Hot keys and keyboard short cuts
Institute of Hotel Management, Hajipur, Patna, Bihar.
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
ma-polimi
 
Microsoft Management Console
Microsoft Management ConsoleMicrosoft Management Console
Microsoft Management ConsoleRaghu nath
 
Visual basic
Visual basicVisual basic
Visual basic
mafffffe19
 
Elem of design unit 8 module 2 the document window
Elem of design unit 8 module 2 the document windowElem of design unit 8 module 2 the document window
Elem of design unit 8 module 2 the document windowkateridrex
 
Android-dialogs in android-chapter14
Android-dialogs in android-chapter14Android-dialogs in android-chapter14
Android-dialogs in android-chapter14
Dr. Ramkumar Lakshminarayanan
 

What's hot (20)

Visual studio ide componects dot net framwork
Visual studio ide componects dot net framworkVisual studio ide componects dot net framwork
Visual studio ide componects dot net framwork
 
Using Applications in Windows - R.D.Sivakumar
Using Applications in Windows - R.D.SivakumarUsing Applications in Windows - R.D.Sivakumar
Using Applications in Windows - R.D.Sivakumar
 
Javagoodbook
JavagoodbookJavagoodbook
Javagoodbook
 
Spf chapter10 events
Spf chapter10 eventsSpf chapter10 events
Spf chapter10 events
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menu
 
Gui
GuiGui
Gui
 
Tutorials2
Tutorials2Tutorials2
Tutorials2
 
How to Fix Windows 8 Crashes
How to Fix Windows 8 CrashesHow to Fix Windows 8 Crashes
How to Fix Windows 8 Crashes
 
02 getting start with android app development
02 getting start with android app development02 getting start with android app development
02 getting start with android app development
 
Lecture 3 INTRODUCTION TO COMPUTER
Lecture 3 INTRODUCTION TO COMPUTERLecture 3 INTRODUCTION TO COMPUTER
Lecture 3 INTRODUCTION TO COMPUTER
 
New_JoinerTool
New_JoinerToolNew_JoinerTool
New_JoinerTool
 
Win8 device Log in
Win8 device Log inWin8 device Log in
Win8 device Log in
 
IDS FortuneNext 6i Property Management: Hot keys and keyboard short cuts
IDS FortuneNext 6i Property Management: Hot keys and keyboard short cutsIDS FortuneNext 6i Property Management: Hot keys and keyboard short cuts
IDS FortuneNext 6i Property Management: Hot keys and keyboard short cuts
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 
Tutorials3
Tutorials3Tutorials3
Tutorials3
 
Microsoft Management Console
Microsoft Management ConsoleMicrosoft Management Console
Microsoft Management Console
 
Visual basic
Visual basicVisual basic
Visual basic
 
Elem of design unit 8 module 2 the document window
Elem of design unit 8 module 2 the document windowElem of design unit 8 module 2 the document window
Elem of design unit 8 module 2 the document window
 
Android-dialogs in android-chapter14
Android-dialogs in android-chapter14Android-dialogs in android-chapter14
Android-dialogs in android-chapter14
 

Viewers also liked

innovative graduation project award
innovative graduation project awardinnovative graduation project award
innovative graduation project awardRAJEEV RANJAN
 
Optimization in refrigeration systems
Optimization in refrigeration systemsOptimization in refrigeration systems
Optimization in refrigeration systems
P.L. Dhar
 
Obesidade visceral sem controle e sua relação com gordura no fígado
Obesidade visceral sem controle e sua relação com gordura no fígadoObesidade visceral sem controle e sua relação com gordura no fígado
Obesidade visceral sem controle e sua relação com gordura no fígado
Van Der Häägen Brazil
 
Normas de etiqueta en Internet (1)
Normas de etiqueta en Internet (1)Normas de etiqueta en Internet (1)
Normas de etiqueta en Internet (1)
jokerhernandez
 
Cloud stackを自分流に振り返る
Cloud stackを自分流に振り返るCloud stackを自分流に振り返る
Cloud stackを自分流に振り返るYasuhiro Arai
 
Mmorpg 10 best games
Mmorpg 10 best gamesMmorpg 10 best games
Mmorpg 10 best games
schoolthungetu1981
 
Presentacion de power point
Presentacion de power pointPresentacion de power point
Presentacion de power point
NathalyA2424
 
A5 poland
A5 polandA5 poland
A5 poland
econoerasmus
 
Normas de etiqueta en internet (1)
Normas de etiqueta en internet  (1)Normas de etiqueta en internet  (1)
Normas de etiqueta en internet (1)
INGRID PINZÓN
 
DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014
DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014
DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014
ALLEN CAREER INSTITUTE
 

Viewers also liked (14)

innovative graduation project award
innovative graduation project awardinnovative graduation project award
innovative graduation project award
 
Optimization in refrigeration systems
Optimization in refrigeration systemsOptimization in refrigeration systems
Optimization in refrigeration systems
 
Obesidade visceral sem controle e sua relação com gordura no fígado
Obesidade visceral sem controle e sua relação com gordura no fígadoObesidade visceral sem controle e sua relação com gordura no fígado
Obesidade visceral sem controle e sua relação com gordura no fígado
 
Normas de etiqueta en Internet (1)
Normas de etiqueta en Internet (1)Normas de etiqueta en Internet (1)
Normas de etiqueta en Internet (1)
 
Lauren REF Letter
Lauren REF LetterLauren REF Letter
Lauren REF Letter
 
Cloud stackを自分流に振り返る
Cloud stackを自分流に振り返るCloud stackを自分流に振り返る
Cloud stackを自分流に振り返る
 
il calendario degli animali 2014
il calendario degli animali 2014il calendario degli animali 2014
il calendario degli animali 2014
 
Cennik acs 2013
Cennik acs 2013Cennik acs 2013
Cennik acs 2013
 
Mmorpg 10 best games
Mmorpg 10 best gamesMmorpg 10 best games
Mmorpg 10 best games
 
Presentacion de power point
Presentacion de power pointPresentacion de power point
Presentacion de power point
 
A5 poland
A5 polandA5 poland
A5 poland
 
portfolio 2016
portfolio 2016portfolio 2016
portfolio 2016
 
Normas de etiqueta en internet (1)
Normas de etiqueta en internet  (1)Normas de etiqueta en internet  (1)
Normas de etiqueta en internet (1)
 
DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014
DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014
DATE SHEET FOR CLASS X CBSE BOARD EXAMINATION 2014
 

Similar to Introduction

Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
marwaeng
 
Gui builder
Gui builderGui builder
Gui builderlearnt
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Design
francopw
 
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7helpido9
 
Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7helpido9
 
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7comp274
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
LalRatan
 
Visual basic
Visual basic Visual basic
Visual basic
Shabista Imam
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
Jeanie Arnoco
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
AOmaAli
 
Programming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI ApplicationProgramming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI Application
Mahmoud Samir Fayed
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
EliasPetros
 
CIS 170 Exceptional Education - snaptutorial.com
CIS 170   Exceptional Education - snaptutorial.comCIS 170   Exceptional Education - snaptutorial.com
CIS 170 Exceptional Education - snaptutorial.com
DavisMurphyB33
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinFormHock Leng PUAH
 
Cis 170 c Enhance teaching / snaptutorial.com
Cis 170 c  Enhance teaching / snaptutorial.comCis 170 c  Enhance teaching / snaptutorial.com
Cis 170 c Enhance teaching / snaptutorial.com
HarrisGeorg51
 

Similar to Introduction (20)

Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
Gui builder
Gui builderGui builder
Gui builder
 
9b4c1 vb(pd)
9b4c1 vb(pd)9b4c1 vb(pd)
9b4c1 vb(pd)
 
9b4c1 vb(pd) (2)
9b4c1 vb(pd) (2)9b4c1 vb(pd) (2)
9b4c1 vb(pd) (2)
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Design
 
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7
 
Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7
 
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7
 
dr_4
dr_4dr_4
dr_4
 
dr_4
dr_4dr_4
dr_4
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
 
Visual basic
Visual basic Visual basic
Visual basic
 
Vb%20 tutorial
Vb%20 tutorialVb%20 tutorial
Vb%20 tutorial
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
 
Programming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI ApplicationProgramming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI Application
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
 
CIS 170 Exceptional Education - snaptutorial.com
CIS 170   Exceptional Education - snaptutorial.comCIS 170   Exceptional Education - snaptutorial.com
CIS 170 Exceptional Education - snaptutorial.com
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
Cis 170 c Enhance teaching / snaptutorial.com
Cis 170 c  Enhance teaching / snaptutorial.comCis 170 c  Enhance teaching / snaptutorial.com
Cis 170 c Enhance teaching / snaptutorial.com
 

Recently uploaded

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Introduction

  • 1. Introduction The Windows-based application you are going to construct is Lucky Seven, a game program that simulates a lucky number slot machine. Lucky seven has a simple user interface and can be created and compiled in just a few minutes using Microsoft Visual Basic. Here’s what your program will look like when it’s finished: Objective: After completing this Unit, you will be able to: 1. Create the user interface for a new program. 2. Set the properties for each object in your user interface. 3. Write program code. 4. Save and run the program. 5. Build an executable file.
  • 2. The process: Programming Steps Programming Steps Number of Items 1. Create the user interface 7 objects 2. Set the properties 13 properties 3. Write the program code 2 objects Creating the User Interface: In this exercise, you will start building Lucky Seven by first creating a new project and then using controls in the Toolbox to construct the user interface. . Create a new project 1. On the Visual Studio File menu, click New Project. 2. Click the Windows Forms Application icon in the central Templates area of the dialog box. 3. In the Name text box, type MyLucky7. Click OK.
  • 3. Do these first steps to open the program and work on it.  Create the user interface 1. Click the Toolbox tab to display the Toolbox window in the IDE 2. Double-click the Button control in the Toolbox, and then move the mouse pointer away from the Toolbox 3. Move & resize the button 4. Repeat the steps for adding more button, four labels, and one picture box.
  • 4. The numbers and types of controls are written above in the picture. That will don after clicking in toolbox. Arrange the form like this form in the picture below. . You can set the properties by using this properties box as you see in the picture below.
  • 5. So these properties you should set it of the control which are created in the form.  The Picture Box Properties 1. Click the picture box object on the form 2. Click the SizeMode property in the Properties window, and then click StretchImage 3. Click the Image property in the Properties window, and then click the ellipsis button in the second column. 4. Click the Local Resource radio button, and then click the Import button. 5. In the Open dialog box, navigate to the folder that contains the digital photo PayCoins.jpg. 6. Select PayCoins.jpg, and then click Open 7. Click the Visible property in the Behavior category of the Properties window, and then click the arrow in the second column. 8. Click False to make the picture invisible when the program starts. 9. Set the properties of other controls so that they appear as in the screen shoot above. Object Button1 Button2 Label1, Label2, Label3 Label4 Property Text Text Auto Size Border Style Font Text Text Align Text Font For Color Setting Spin End False Fixed Single Times New Roman, Bold, 24-point “0” Middle Center Lucky Seven” Arial, Bold, 18-point Purple Writing the Code  Use the Code Editor When you double click at the control you will see this form come out.
  • 6. 1. Double-click the End button on the form Inside the Code Editor are program statements associated with the current form. Program statements that are used together to perform some action are typically grouped in a programming construct called a procedure. A common type of procedure is a Sub procedure. Sub procedures include a Sub keyword in the first line and end with End Sub. Procedures are typically executed when certain events occur, such as when a button is clicked. When a procedure is associated with a particular object and an event, it is called an event handler. When you double-clicked the End button (Button2), Visual Studio automatically added the first and last lines of the Button2_Click event procedure. 2. Type End, and then press the ENTER key Write code for the Spin button 1. Double-click the Spin button. 2. Type the following program lines between the Private Sub and End Sub statements: PictureBox1.Visible = False ' hide picture Label1.Text = CStr(Int(Rnd() * 10)) ' pick numbers Label2.Text = CStr(Int(Rnd() * 10)) Label3.Text = CStr(Int(Rnd() * 10)) ' if any number is 7 display picture and beep If (Label1.Text = "7") Or (Label2.Text = "7") Or (Label3.Text = "7") Then PictureBox1.Visible = True Beep() End If 3. Click the Save All command on the File menu to save your additions to the program Running Visual Basic Applications * Run the Lucky Seven program 1. Click the Start Debugging button on the Standard toolbar. The Lucky Seven program compiles and runs in the IDE. After a few seconds, the user interface appears, just as you designed it.
  • 7. 2. Click the Spin button. The program picks three random numbers and displays them in the labels on the form, as follows:   Adding to a Program 1. Double-click the form to display the Form_Load procedure. The Form_Load procedure appears in the Code Editor. 2. Type Randomize, and then press ENTER The Randomize statement is added to the program and will be executed each time the program starts. Randomize uses the system clock to create a truly random starting point, or seed, for the Rnd statement used in the Button1_Click procedure. 3. Run the new version of Lucky Seven, and then save the project. Activities 1. Use visual basic program and create your own game by the program. Materials: Text: An Introduction to Visual Basic 2010, Schneider, Prentice Hall ISBN-13: 978-0-13212856-8 You will also need a thumb drive or other memory device and a loose-leaf binder for the handouts, online materials, and printouts of the programs. Software: Visual Studio Express is free and can be downloaded from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express