EBK STARTING OUT WITH VISUAL C#
5th Edition
ISBN: 9780135204818
Author: GADDIS
Publisher: VST
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
Using C# language please in Visual Studio 2022 in Windows Form App.
As for the folder-- for convenience sake-- create some folders and insert a couple of names in there, not 200.
What is the purpose of the following OpenFileDialog and SaveFileDialog properties? InitialDirectory Title Filename
Language in C# using Visual Studio in Windows Form app please.
For the name files, just create a text file that has a few names for your time sake.
Chapter 5 Solutions
EBK STARTING OUT WITH VISUAL C#
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
- JS events? Click code.arrow_forwardIt should be designed as a Desktop Application (with GUI) developed with Java programming language.Note that you are not designing a Web Application or a Mobile Application.Create a project named “FavoriteBooks” which keeps a list of the books that a user has read and liked.This list is stored in a text document (.txt) file and for each book it keeps the following data separated by acomma (,):Book id, Title, Category, First Author Name and Surname, Award Winner, Rating, Year, Number of Pages, andShort Description. Book id: The data type of “Book id” is integer and will be incremented automatically by 1 whenever anew book is added to the list. Title: The data type of “Title” is String. Category: The data type of “Category” is String. It shows the category of a Book such as Arts, Biography,History, Science Fiction, Cookbook, Literature, etc.. First Author Name and Surname: The data type of “Author Name and Surname” is String. Award Winner: The data type of “Award” is String. If the…arrow_forwardTrue or False: Object privileges allow you to add and drop usersarrow_forward
- Boat Race Define a class named BoatRace that contains the following information about a Boat Race: race_name: string race_id: int distance: int racers: List of Boat objects Write a constructor that allows the programmer to create an object of type BoatRace with a race_name, race_id, list of racers objects, and distance. The constructor will only take in one parameter, a string representing the name of a CSV file. The file will have the following format: Each row will always have exactly two columns. The first row will always contain the name of the race. The second row will always contain the id number for the race. The third row will always contain the distance for the race. All remaining rows contain information about the boats involved in the race: the first column will be the name of the boat, and the second column is that boat’s top speed. For example, the race in the file below has two boats: The Fire Ball with top speed 12, and The Leaf with top speed 100. Name,The…arrow_forwardC# langauge. In visual studio 2022 for folders, create some folder and type a few names.arrow_forwardEach of the following files in the Chapter.01 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugOne1.cs will become FixedDebugOne1 .cs. a. DebugOne1.cs b. DebugOne2.cs c. DebugOne3.cs d. DebugOne4.csarrow_forward
- Each of the following files in the Chapter.10 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugTen01.cs will become FixedDebugTen01 .cs. a. DebugTen01.cs b. DebugTen02.cs c. DebugTen03.cs d. DebugTen04.csarrow_forwardOpen the Palace Solution.sln file contained in the VB2017\Chap10\Palace Solution folder. Use Windows to copy the Rectangle.vb file from the VB2017\Chap10 folder to the Palace Project folder. Then, use the Add Existing Item option on the Project menu to add the file to the project. Modify the Rectangle class to use Double variables rather than Integer variables. Change the name of the GetArea method to GetAreaSqFt. Add another method to the class. Use Get AreaSqYds as the method’s name. The method should calculate and return the area of a rectangle in square yards. The application’s Calculate button should calculate and display the number of square yards of carpeting needed to carpet a rectangular floor. Code the btnCalc_Click procedure. Display the number of yards with one decimal place. Save the solution and then start and test the application.arrow_forwardOutput to a file can be achieved with a _____ object, which is constructed with a File and has the same methods as System.out (the class name is case sensitive)(Just Words)arrow_forward
- The Java class that we use to allow the user to navigate through folders and select a file is called : JFileSelect InFile JFileChooser This is not an option in Java.arrow_forwardWhich of the following interfaces or classes would be the most appropriate structure to store a collection containing the names of fruits you eat weekly with no duplicates?a) ArrayListb) LinkedListc) HashSetd) All of the abovearrow_forwardT or F Number fields store values that represent quantities, measurements, and scores, for example. T or F The introduction should be the principal section of a formal report. T or F The Import Spreadsheet Wizard can help you import data from Excel into a new Access table. Which of the following properties can you set for a Short Text field? Format Decimal Places Default Value Input Mask What type of graphic illustrates changes in data over time? Line chart Flowchart Pie chart Tablearrow_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,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning