Visual Basic 2013-0049

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

The presence of a 7 also triggers the sound effect, which lasts a few seconds and sounds a bit

like an electronic slot machine. You win!

3. Click the Spin button 15 or 16 more times, watching the results of the spins in the number text
blocks.

About half the time you spin, you hit the jackpot—pretty easy odds. (The actual odds are
about 2.8 times out of 10; you're just lucky at first.) Later on, you might want to make the
game tougher by displaying the photo only when two or three 7s appear, or by creating a run-
ning total of winnings.

4. When you've finished experimenting with your new creation, close the Windows Store app.

The program stops, and the IDE reappears on your screen. Click the Stop Debugging button
on the toolbar to end the program. Now you'll add a splash screen to the project.

Chapter 3  Creating your first Windows Store application   69


Creating a splash screen for your app
A splash screen is a transitional image that appears when your app first launches. Every Windows
Store app must have a splash screen, which consists of an image (or text) and a surrounding back-
ground color. The splash screen is stored in the Assets folder within Solution Explorer, and every new
Windows Store app has a basic splash screen that is created by default. You'll also see tile images in
the Assets folder, which you'll learn to customize in Chapter 9, "Exploring Windows 8.1 design features:
Command bar, flyout, tiles, and touch."

Although you can create a splash screen with Microsoft Paint or another third-party graphics
program, you can also create a simple splash screen within Visual Studio. Just remember that a splash
screen appears very briefly when you first launch your app. Accordingly, this is not the place to put
elaborate program instructions or copyright information. You'll want to avoid placing advertisements
or version information on a splash screen.

Instead, use the splash screen to offer a preview of the functionality of your app in some unique
way. Consider an image or photo that will be easily adapted to other countries and cultures (that is,
easily localizable) and that can be displayed effectively in different screen resolutions. Notice that
Portable Network Graphics (.png) format is used because this file type is capable of displaying alpha
transparency and 24-bit color images. When part of an image is formatted as transparent, the back-
ground color will be displayed behind it. (You'll see this in most splash screens and tiles in Windows
Store and Windows Phone apps.)

Create a Lucky Seven splash screen

1. In Solution Explorer, open the Assets folder, and then double-click the file SplashScreen.scale-
100.png.

2. This action opens the Image Editor Designer in Visual Studio, and loads the SplashScreen.
scale-100.png file into the editor. Your screen looks like this:

70  PART I  Introduction to Visual Studio Development

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy