|
-
Jun 21st, 2006, 06:27 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2005] Graphical List
I want to build a choose for the user between a list of items, but instead of a text list I want it to be graphical. I am currently using a ListView to display the pictures, but this is less than optimal.
One thought I had was to build a table with a number of PictureBoxes each containing one selection. The main reason I haven't done this is because I'm unsure how to show which one is currently selected persistently (ie when the user clicks somewhere else). Also, it seems like a lot of extra code to write, whereas the listview is almost what I want with very little code.
Any suggestions?
-
Jun 21st, 2006, 06:42 PM
#2
Re: [2005] Graphical List
If you aren't going to use the ListView then a TableLayoutPanel or FlowLayoutPanel with a PictureBox in each cell is probably your best bet. Indicating which image is selected is as easy as setting the BorderStyle property of the PictureBox.
-
Jun 21st, 2006, 06:56 PM
#3
Thread Starter
Hyperactive Member
Re: [2005] Graphical List
Sounds like a plan.
What I'd really love though is a drop-down box that has the images, because then the space overhead is tiny and I can reuse the space that would be taken up with the other images. As far as I know I'd have to create a new control to handle that (which seems a little scary ).
If creating a new control is simple enough that might be the way to go, but I like the border style idea. I'll use that if I can't get anything else to work the way I want it to.
Thanks
Edit: I tried that, and it works great, except the images are not the correct size. Currently, I am using an imageList to store them and referencing that to display the images, but I cannot figure out how to resize them. Thoughts?
Last edited by ZaNi; Jun 21st, 2006 at 07:01 PM.
-
Jun 21st, 2006, 07:01 PM
#4
Re: [2005] Graphical List
Put your layout panel inside a regular Panel with its AutoScroll set to True. Then when you have too many images to fit inside the parent Panel it will display scroll bars, so you could have a Panel that was tall enough to display a single row of images but within which you could have thousands of rows if you don't mind the user scrolling that much.
-
Jun 21st, 2006, 07:03 PM
#5
Thread Starter
Hyperactive Member
Re: [2005] Graphical List
The problem with that is that I want it possible to *view* them all at once, but I don't need the unselected ones taking up space the rest of the time...
-
Jun 21st, 2006, 07:25 PM
#6
Re: [2005] Graphical List
Then I'd suggest a single PictureBox for the selected image and a Browse button that opens a dialogue displaying all the images from which they can select one.
-
Jun 21st, 2006, 07:36 PM
#7
Thread Starter
Hyperactive Member
Re: [2005] Graphical List
For clarity, the user is not selected the image they want; rather they are choosing an option which is quicker and easier to represent graphically then as text.
It seems to be going well so far. Now I've run into a new problem: I cannot seem to get the picture to have a transparent background. I've loaded them as resources now so that each can be in an individual picturebox, and I've been playing to try and get the background correct, but am having trouble. Any suggestions for that?
Thanks for all the help so far: its made this a lot easier
Edit: this is what I've found so far
Edit(2): I am now having trouble setting the background of the image to be transparent or opaque... I'll open a new thread for this.
Last edited by ZaNi; Jun 21st, 2006 at 08:37 PM.
Reason: Added link
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|