Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 5.7, Problem 5.34CP
Explanation of Solution
OpenFileDialog control:
- • The “OpenFileDialog” control displays a standard Windows “Open” dialog box.
- • The “Open” dialog box allows user to open the existing file because it helps to browse system and select the desired file.
- • To add an “OpenFileDialog” control to a form, the “OpenFileDialog” tool is been double-clicked under the “Dialogs” group in “Toolbox” window.
- • The control appears in component tray at bottom of “Designer”.
- • The default name given to control is “openFileDialog1”.
- • Some of the properties are listed below:
- ○ InitialDirectory
- ○ Title
- ○ Filename
- • InitialDirectory:
- ○ The open dialog box displays the contents of user’s document directory or folder.
- ○ The path could be stored in “InitialDirectory” property to specify another directory to be initially displayed.
- ○ The syntax for specification is shown below:
openFile.InitialDirectory = "D: \\Info";
- • Title:
- ○ The word “Open” is displayed in OpenFileDialog box title bar.
- ○ To change the title, default text displayed in title bar.
openFile.InitialDirectory = "D: \\Info";
openFile.Title = "My Title";
- • Filename:
- ○ When user chooses a file with OpenFileDialog box, the file’s path and file name are stored in control’s Filename property.
SaveFileDialog control:
- • The “SaveFileDialog” control displays a standard Windows “Save As” dialog box...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
create an Android application to display a contact list using RecyclerView. The details of the java files you need to create are described below.
The first Java file should contain a data field in this case: Person_name, Phone_number.
The second java file contains ContactViewHolder.
The third java file contains the ContactAdapter.
The MainActivity java file will contain some sample data to display.
What will be displayed if the user inputs 10 in TextBox1 and “F” in TextBox2?
Dim age As IntegerDim gender As Stringgender = TextBox1.textage = TextBox2.textIf age > 5 AND gender = “F” Then MsgBox (“HI”)ElseIf age <=5 AND gender = “F” Then MsgBox (“GOODBYE”)Else MsgBox(“INVALID”)End If
It holds the filenames of the files included in your project in VB.
Select one:
a. Property Box
b. Tool Box
c. Solution Explorer
d. Tool Bar
What JavaScript statement should you use first when you need to read the contents of a file on a web page user’s computer?
a.
userFile.readyState(load);
b.
let reader = new ReaderObject();
c.
userFile.readAsText();
d.
let reader = new FileReader();
Chapter 5 Solutions
Starting out with Visual C# (4th Edition)
Ch. 5.1 - Prob. 5.1CPCh. 5.1 - Prob. 5.2CPCh. 5.1 - Prob. 5.3CPCh. 5.2 - What is a loop iteration?Ch. 5.2 - What is a counter variable?Ch. 5.2 - What is a pretest loop?Ch. 5.2 - Does the while loop rest its condition before or...Ch. 5.2 - What is an infinite loop?Ch. 5.3 - What messages will the following code sample...Ch. 5.3 - How many rimes will the following loop iterate?...
Ch. 5.4 - Name the three expressions that appear inside the...Ch. 5.4 - You want to write a for loop that displays I love...Ch. 5.4 - What would the following code display? for (int...Ch. 5.4 - What would the following code display? for (int...Ch. 5.5 - What is a posttest loop?Ch. 5.5 - What is the difference between the while loop and...Ch. 5.5 - How many times will the following loop iterate?...Ch. 5.6 - What is an output file?Ch. 5.6 - What is an input file?Ch. 5.6 - What three steps must be taken by a program when...Ch. 5.6 - What is the difference between a text file and a...Ch. 5.6 - Prob. 5.22CPCh. 5.6 - What type of object do you create if you want to...Ch. 5.6 - What type of object do you create if you want to...Ch. 5.6 - If you call the File.CreateText method and the...Ch. 5.6 - If you call the File.AppendText method and the...Ch. 5.6 - What is the difference between the WriteLine and...Ch. 5.6 - What method do you call to open a text file to...Ch. 5.6 - What is a files read position? Initially, where is...Ch. 5.6 - How do you read a line of text from a text file?Ch. 5.6 - How do you close a file?Ch. 5.6 - Assume inputFile references a StreamReader object...Ch. 5.7 - What is the benefit of using an Open and/or Save...Ch. 5.7 - Prob. 5.34CPCh. 5.8 - What does a Random objects Next method return?Ch. 5.8 - What does a Random objects NextDouble method...Ch. 5.8 - Write code that creates a Random object and then...Ch. 5.8 - Write code that creates a Random object and then...Ch. 5.8 - Prob. 5.39CPCh. 5.8 - What happens if the same seed value is used each...Ch. 5.9 - Prob. 5.41CPCh. 5.9 - Prob. 5.42CPCh. 5 - ListBox controls have an __________ method that...Ch. 5 - A __________ is commonly used to control the...Ch. 5 - A(n) __________ loop tests its condition before...Ch. 5 - The term __________ is used to describe a file...Ch. 5 - The term __________ file is used to describe a...Ch. 5 - A __________ file contains data that has been...Ch. 5 - When you work with a __________ file you access...Ch. 5 - Prob. 8MCCh. 5 - A __________ object is an object that is...Ch. 5 - When a program works with an input file, a special...Ch. 5 - When the user selects a file with the Open dialog...Ch. 5 - The __________ control displays a standard Windows...Ch. 5 - Once you have created a Random object, you can...Ch. 5 - Prob. 14MCCh. 5 - When you run an application, the applications form...Ch. 5 - If the ListBox is empty, the Items.Count property...Ch. 5 - To increment a variable means to increase its...Ch. 5 - When a variable is declared in the initialization...Ch. 5 - The while loop always performs at least one...Ch. 5 - The term read file is used to describe a file that...Ch. 5 - To append data to an existing file, you open it...Ch. 5 - As items are read from the file, the read position...Ch. 5 - The numbers that are generated by the Random class...Ch. 5 - Prob. 10TFCh. 5 - What is contained in the body of a loop?Ch. 5 - Write a programming statement that uses postfix...Ch. 5 - How many iterations will occur if the test...Ch. 5 - What are filename extensions? What do they...Ch. 5 - When an input file is opened, what is its read...Ch. 5 - How can you read all of the items in a file...Ch. 5 - What is a variable that is used to accumulate a...Ch. 5 - By default, the Open dialog box displays the...Ch. 5 - Prob. 9SACh. 5 - Prob. 10SACh. 5 - Write a loop that displays your name 10 times.Ch. 5 - Write a loop that displays all the odd numbers...Ch. 5 - Write a loop that displays every fifth number from...Ch. 5 - Write a code sample that uses a loop to write the...Ch. 5 - Assume that a file named People.txt contains a...Ch. 5 - Distance Calculator If you know a vehicles speed...Ch. 5 - Distance File Modify the Distance Calculator...Ch. 5 - Celsius to Fahrenheit Table Assuming that C is a...Ch. 5 - Prob. 4PPCh. 5 - Pennies for Pay Susan is hired for a job, and her...Ch. 5 - Prob. 6PPCh. 5 - Prob. 7PPCh. 5 - Prob. 8PPCh. 5 - Prob. 9PPCh. 5 - Addition Tutor Create an application that...Ch. 5 - Random Number Guessing Game Create an application...Ch. 5 - Calculating the Factorial of a Number In...Ch. 5 - Random Number File Writer Create an application...Ch. 5 - Random Number File Reader This exercise assumes...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- What type of object is created by the OpenText method? a. File b. SequenceReader c. StreamWriter d. None of the above.arrow_forwardMy code I getting this Traceback (most recent call last): File "/usercode/main.py", line 46, in <module> cs261_answer = input("\nQUESTION 8\nHave you taken CS261? (Yes or No): ").strip().upper()EOFError: EOF when reading a line required_cs_credits_earned = 0 # Print the header print("--------------------------------") print(" UIC CS Track") print("--------------------------------\n") # QUESTION 1: Are you a CS major? major_answer = input("QUESTION 1\nAre you a CS major? (Yes or No): ").strip().upper() if major_answer == "YES": # QUESTION 2: Have you taken ENGR100? engr100_answer = input("\nQUESTION 2\nHave you taken ENGR100? (Yes or No): ").strip().upper() # QUESTION 3: Have you taken CS111? cs111_answer = input("\nQUESTION 3\nHave you taken CS111? (Yes or No): ").strip().upper() if cs111_answer == "YES": required_cs_credits_earned += 3 # QUESTION 4: Have you taken CS141? cs141_answer = input("\nQUESTION 4\nHave you taken…arrow_forwardYou have created the following property in your RegisterViewModel and you want this field to use the password options you previously set in your Startup.cs. What line of code do you need to add? [Required(ErrorMessage = "Please enter a password.")] _________________________________________ [Compare("ConfirmPassword")] public string Password { get; set; } 1. [DataType(DataType.Password)] 2. [Type = Password] 3. Source="Password"; 4. Startup.csarrow_forward
- Which file contains default information such as UID and GID ranges and minimumpassword length to be used at user creation?a. /etc/skelb. /etc/passwdc. /etc/login.defsd. /etc/default/useraddarrow_forwardUnicornBox stores some configuration variables in a config.yml file in a folder separate from the users’ files: The layout of the server storage is as follows: site/ file/ foo1.txt foo2.txt ... config/ config.yml Your task: Gain access to the secrets stored within config.yml. Tip: Most browsers modify URLs before they are truly actually sent to the server. If you are having trouble determining what URLs are sent to the server, consider using the Network tab of your browser’s debugger. Tip: What happens if you try to access a file that your user account doesn’t have access to? Consider what has to be true before a file is “served” from the file system in this website.arrow_forwardPlease kindly attach output SS A social networking website hires you to meet the following requirements: User can create their profile User can check for mutual friends User can add new friends User can delete friends Display user’s profile Solution Guidelines: Create a class Profile having name, emailId, city , country, friendlist[] ( Keep the fields private) Profile class will contain following methods: createProfile(String name , String emailId, String city, String country): allow user to set his information addFriends(Profile profile): sends request, if a person accepts the request add the person object into friendlist[] Note: Achieve Method Overloading keep the parameters as (Profile profile , String Message) giving Access to user to send request with a personalized message. removeFriend(Profile profile):can remove a friend from the friendlist showFriends(): display the friendlist search(Profile profile):searches for profile in the list if it…arrow_forward
- I am looking for the following in your program: Python GUI-based MP3 Player Project #3: Python GUI-based MP3 Player 1. Ability to select a folder / directory for MP3s. (HINT: There’s a function/method in filedialog of tkinter to do this. In other words, you'll need the following import: from tkinter import messagebox, filedialog 2. Ability to play selected MP3s. 3. Ability to pause the current MP3. 4. Quit button/function to exit application. 5. Use a list to store and display the mp3 file names. You will need to demonstrate your mastery of lists, loops, and GUI elements within this program. Submission will include: 1. Python program named myplayer.py 2. Data Flow Diagrams / Pseudocode 3. If choosing an alternate library to tkinter or pygame, provide instructions and download links for the alternate library.arrow_forwardA student wants to write into a file called myfile, without deleting its existing content. Which one of the following functions should he or she use? f = open('myfile', 'r') f = open('myfile', 'w+b') f = open('myfile', '+') f = open('myfile', 'a')arrow_forward1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive.2. Create a new project named LabExer8. Set the project location to your own folder.3. Construct import statements to use the packages listed below:• javax.swing• java.awt• java.awt.event4. Extend the JFrame class and implement the ActionListener interface.5. Create a JMenuBar named mainBar and two (2) JMenu objects named menu1 and menu2. Set thetext of menu1 as File and the text of menu2 as Event Type.6. Create the items that will appear in the menus. The File menu shall contain an Exit submenu. Namethe object exit. The Event Types menu shall contain two (2) submenus: Adult and Child. Name theobjects adult and child, respectively. The Adult submenu shall consist of: Birthday (adultBday),Anniversary (anniv), Retirement (retirement), and Other (adultOther). The Child submenu shallconsist of Birthday (childBday), and Other (childOther).7. Declare several other components that will be used in the program.…arrow_forward
- React Create hover calendar I have a calendar icon in react and I want to display a calendar when hovering over the calendar icon in react: here is code: <div className="date-choose pad-left-0 pad-right-0"> <span className="enhanced-sports enhanced-sports-calendar" /> </div> Please give proper explanation and typed answer only.arrow_forwardINSTRUCTIONS:Your client owns a bookstore, and you will find attached; a text file called Samsbooks.txt withtitles of all the books in the store. Write and Print all the duplicate titles to a file calledSamsDuplicate.txt. : BOOK TITLES And Then It's Spring Baby Bear Sees Blue Beach Feet Jimmy the Greatest! Boot & Shoe Boy & Bot Cat Tale Creepy Carrots! Jimmy the Greatest! Dog in Charge Eggs 1 2 3 Extra Yarn Ganesha's Sweet Tooth Green Happy Like Soccer H.O.R.S.E.: A Game of Basketball and Imagination The Insomniacs Boy & Bot It's a Tiger! Jimmy the Greatest! King Arthur's Very Great Grandson Me and Momma and Big John The Quiet Place Robin HoodStep Gently Out Up, Tall and High Z Is for Moose The Elephant's Friend and Other Tales from Ancient India.The Goldilocks Variations The Great Race: An Indonesian Trickster TaleKing Arthur's Very Great Grandson Hans My Hedgehog: A Tale from the Brothers Grimm. Paul Bunyan and Babe the Blue Ox: The Great Pancake Adventure Robin HoodThe…arrow_forwardHere are what to display on your Pokémon's show page: The pokemon's name The image of the pokemon An unordered list of the Pokemon's types (eg. water, poison, etc). The pokemon's stats for HP, ATTACK, and DEFENSE. Routes Your app should use RESTful routes: Index GET /pokemon Show GET /pokemon/:id New GET /pokemon/new Edit GET /pokemon/:id/edit Create POST /pokemon Update PUT /pokemon/:id Destroy DELETE /pokemon/:id This is the module.js file module.exports = [ { id: "001", name: "Bulbasaur", img: "http://img.pokemondb.net/artwork/bulbasaur.jpg", type: [ "Grass", "Poison" ], stats: { hp: "45", attack: "49", defense: "49", spattack: "65", spdefense: "65", speed: "45" }, moves: { level: [{ learnedat: "", name: "tackle", gen: "V" }, { learnedat: "3", name: "growl", gen: "V" }, { learnedat: "7", name: "leech seed", gen: "V" }, {…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L