Wrox Programmer Forums
|
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2011, 01:29 PM
Registered User
 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 2 Exercise 3 - how to add resources

I downloaded the solution, but can't seem to figure out how to add my 2 .gif images properly. The Example has the two .png files added as resources. How do you do that?

Many Thanks,
Jim

Great book and accompanying presentations. If you had an audio only version the presentations woudl blegood reviews to listen to in the car.
 
Old April 11th, 2011, 02:31 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Hi Jim,

It depends a bit on what you want to do with the files. Two common reasons are (1) to manage the file with the rest of the project and (2) to use it as an image in a PictureBox or something similar.

(1) To manage the file with the rest of the project. For example, you might want to set the file's "Copy to Output Directory" property to True so it gets copied into the executable directory so the exe can find it easily.

To do this, open the Project menu and select Add Existing Item. (Alternatively right-click the project in Solution Explorer, open the Add submenu, and select Existing Item.) Select the file and click Add.

Now you can click the file in Solution Explorer and set Copy to Output Directory. Depending on the version of Visual Studio, you may also be able to double-click the file to open it in an editor.

(2) To display the file in a PictureBox. First, you don't need to add the file to the project in the way described above.

Click on the PictureBox. In the Properties window, click on the Image property, and then click on the ellipsis to the right. A dialog appears showing images that have already been imported for use. If the image you want isn't there (it won't be initially), click the Import button, find the file, and click Open.

Now the image should appear in the list of imported files. Select it and click OK to use it as the PictureBox's image.

You may then want to set the PictureBox's SizeMode property, for example to AutoSize or Zoom.

Let me know if that doesn't answer your question.

Quote:
Great book and accompanying presentations. If you had an audio only version the presentations woudl blegood reviews to listen to in the car.
I'm glad you're finding it useful. Post a review when you get a chance!

I'll have to think about audio-only material. It would have to be a topic where you don't need to see anything to make sense of it. It might also be good if it weren't too distracting so you don't crash your car while listening . It might be good for broad principle, background, and design topics, though. Hmm...
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 exercise 2 weekapaugh BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 2 March 11th, 2010 02:28 AM
Chapter 4 Exercise 4 Will BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 2 September 18th, 2009 11:08 AM
chapter 3 exercise 4 walkamongus BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 0 September 10th, 2007 09:34 PM
chapter 9 exercise michaelcode BOOK: Beginning ASP.NET 1.0 1 April 9th, 2006 03:56 PM
Chapter 3 Exercise 3 Matt WAXON BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 July 4th, 2005 02:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.