Create a marquee application (a marquee is a box with scrolling text) that allows the user...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a marquee application (a marquee is a box with scrolling text) that allows the user to enter a sentence and click the Marquee button (as shown). The entered text will then scroll through the larger text box at the bottom at a periodic scroll rate of 600ms. The application should adhere to the following requirements: The box at the bottom is a disabled text box with a font-size of 72pt. The Marquee Text label should be a shortcut for the text box. • The Marquee button should be the form's AcceptButton (see the form's AcceptButton property). The Marquee button should initially be disabled. • The Marquee button should only be enabled when the text box contains text. The form should create a BlockingCollection<string> as a class field. • When the user clicks the Marquee button, the text in the text box should be added to the BlockingCollection<string>, the text box should be cleared, and the focus should be put back in the text box. • When the application starts, a thread (described below) should be created and started. Use a foreground thread. A Cancellation Token will be used to stop the thread. • When the application is closed (i.e., the form's FormClosed event), the program should indicate that adding to the BlockingCollection<string> is complete and should signal cancel to the thread (using the cancellation token source). The thread should behave as follows: • Ensure that when the cancellation token signals cancel, the thread is interrupted. • Then, as long as the BlockingCollection<string> is not complete (adding not complete or not empty), the thread should: . ▪ Get a string from the BlockingCollection<string> (blocking if necessary). Pass the cancellation token to the collection's Take method. ▪ Set the string as the text in the display text box at the bottom adding enough spaces in the front to ensure that the text is pushed just out of the view in the text box (you'll have to discover how many spaces you need through trial and error). ▪ Then, every 600ms, the thread should remove the first character from the display text box until the text box is empty. • Make sure that all reading and writing of control properties is done in a thread-safe manner. Be sure to catch the appropriate exceptions when the thread is interrupted or if the blocking collection's Take operation is aborted. These exceptions signal that the thread should exit (end). Create a marquee application (a marquee is a box with scrolling text) that allows the user to enter a sentence and click the Marquee button (as shown). The entered text will then scroll through the larger text box at the bottom at a periodic scroll rate of 600ms. The application should adhere to the following requirements: The box at the bottom is a disabled text box with a font-size of 72pt. The Marquee Text label should be a shortcut for the text box. • The Marquee button should be the form's AcceptButton (see the form's AcceptButton property). The Marquee button should initially be disabled. • The Marquee button should only be enabled when the text box contains text. The form should create a BlockingCollection<string> as a class field. • When the user clicks the Marquee button, the text in the text box should be added to the BlockingCollection<string>, the text box should be cleared, and the focus should be put back in the text box. • When the application starts, a thread (described below) should be created and started. Use a foreground thread. A Cancellation Token will be used to stop the thread. • When the application is closed (i.e., the form's FormClosed event), the program should indicate that adding to the BlockingCollection<string> is complete and should signal cancel to the thread (using the cancellation token source). The thread should behave as follows: • Ensure that when the cancellation token signals cancel, the thread is interrupted. • Then, as long as the BlockingCollection<string> is not complete (adding not complete or not empty), the thread should: . ▪ Get a string from the BlockingCollection<string> (blocking if necessary). Pass the cancellation token to the collection's Take method. ▪ Set the string as the text in the display text box at the bottom adding enough spaces in the front to ensure that the text is pushed just out of the view in the text box (you'll have to discover how many spaces you need through trial and error). ▪ Then, every 600ms, the thread should remove the first character from the display text box until the text box is empty. • Make sure that all reading and writing of control properties is done in a thread-safe manner. Be sure to catch the appropriate exceptions when the thread is interrupted or if the blocking collection's Take operation is aborted. These exceptions signal that the thread should exit (end).
Expert Answer:
Answer rating: 100% (QA)
1 Create a new Windows Forms Application in Visual Studio 2 Design the form with the following controls TextBox for user input Label for Marquee Text ... View the full answer
Related Book For
Corporate Finance
ISBN: 978-0077861759
10th edition
Authors: Stephen Ross, Randolph Westerfield, Jeffrey Jaffe
Posted Date:
Students also viewed these databases questions
-
Function overloading or method overloading allows oneto create multiple functions of the same name with different implementations. make a class named Chat . Add the following variables: 1. List...
-
A software company sells three packages, Package A, Package B, and Package C, which retail for $99, $199, and $299, respectively. Quantity discounts are given according to the following table:...
-
How does deviance play a role in the ideal society? explain
-
Suppose you have the following training set, and fit a logistic regression classifier : ho(x) = g(00+011+0x2) O O O Which of the following are true? Check all that apply. a) Adding polynomial...
-
You invested a total of $12,000 at 4 1/2% and 5% simple interest. During one year, the two accounts earned $580. How much did you invest in each account?
-
Some members of management of the Fairface Cosmetics Firm believe that demand for its products is related to the promotional activities of local department stores where its cosmetics are sold....
-
To what does an auditor's opinion relate when an entity's financial statements are prepared on a comprehensive basis of accounting other than GAAP?
-
Tower Interiors has made the forecast of sales shown in the following table. Also given is the probability of each level of sales. Sales Probability $200,000 ........ 0.20 300,000 ......... 0.60...
-
Sterling Optical andRoyal Optical both make glass frames and each is able to generateearnings before interest and taxes of $136,000. The separatecapital structures for Sterling and Royal are shown...
-
What characteristics of a property, plant, and equipment item make it different from other assets, such as accounts receivable or inventory?
-
A firm has developed the following supply, demand, cost and inventory data. Supply Capacity (units) Overtime 10 15 10 Period 1 2 3 Regular 45 35 35 Initial Inventory Regular time cost /unit Overtime...
-
How does value chain analysis help maintain competitive advantage?
-
Explain how the stockholding period is calculated.
-
Explain how the current ratio is calculated.
-
How is role reversal influential?
-
Vince Rizzo, played by Andy Garcia, is a corrections officer who secretly wants to be an actor. He hides this fact and his secret acting lessons from his wife Joyce, played by Julianna Margulies, so...
-
During the experiment, the data given below was recorded Volume of water 450cm3 Initial temperature of water 250C Final temperature of water 46.50C Mass of ethanol + lamp before burning 125.5g Mass...
-
Figure displays a 12.0 V battery 3 four uncharged capacitors of capacitances C1 = 4.00F, C2 = 6.00F, and C3 = 3.00F. The switch is thrown to the left side until capacitor 1 is fully charged. Then the...
-
Warf Computers, Inc., was founded 15 years ago by Nick Warf, a computer programmer. The small initial investment to start the company was made by Nick and his friends. Over the years, this same group...
-
You bought a stock three months ago for $43.18 per share. The stock paid no dividends. The current share price is $46.21. What is the APR of your investment? The EAR?
-
Do you agree or disagree with the following statement: In an efficient market, callable and noncallable bonds will be priced in such a way that there will be no advantage or disadvantage to the call...
-
Show that \[ \gamma_{i}=\frac{\bar{\phi}_{i}}{\phi_{i}} \]
-
Carbon dioxide occupies a tank at \(100^{\circ} \mathrm{C}\). If the volume of the tank is \(0.5 \mathrm{~m}^{3}\) and the pressure is \(500 \mathrm{kPa}\), determine the mass of the gas in the tank.
-
Give an informatory note on saturation temperature and saturation pressure.
Study smarter with the SolutionInn App