Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 July 29th, 2004, 01:00 PM
Registered User
 
Join Date: Jun 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default image in label--HELP

In VB.Net, how can you display an image in a label? The image will change each time the user selects a radio button. There are 8 different radio buttons.

Thanks
 
Old July 29th, 2004, 01:35 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Shouldn't you be using a picturebox, not a label?
 
Old July 29th, 2004, 03:11 PM
Registered User
 
Join Date: Jun 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought since I was changed the image every time you selected a different country, it would be easier to use a label than a picture box.

Do you think a picture box would be better?
 
Old July 29th, 2004, 03:20 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have never done anything like this before and my knowledge of this particular issue is a little fuzzy, but picture box seems to be the specialized control for this. Nevertheless, if you wish to use a label (and indeed I could be wrong about the picture box) the propety you want is image.
 
Old July 29th, 2004, 04:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Add a ImageList to your form, and add the eight images you want to display. Then in the option buttons events add something like:

Label1.Image = ImageList1.Images.Item(lImageIndex)

Marco
 
Old July 29th, 2004, 04:35 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Marco,

Which is better Picture box or label?

Yehuda
 
Old July 30th, 2004, 01:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Depends on what you need to do. The label and image controls are much lighter, and use much less resources. The picture box can be used as a container, you can use it with any graphics methods, and it can be aligned.
Marco





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
Copy kodak image edit control's image to clipboard vishwanathduddilla Visual Studio 2005 0 November 3rd, 2008 10:10 AM
set image on <asp:Image> stored in DataBase myself.panku ASP.NET 2.0 Professional 1 August 11th, 2008 10:41 AM
how to see a label hombre Java Basics 3 March 4th, 2008 06:15 AM
Document Image Processing (DIP) - changing image f ALcom Access 0 March 27th, 2006 06:10 AM





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