Jump to content

Quick question - listbox like the one in the vista start menu

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
hampus.tagerud

hampus.tagerud

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
Hi! Is there any listbox like the one in the vista start menu?

Edited by Roger, 09 January 2011 - 12:42 PM.


#2
so1i

so1i

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 312 posts

hampus.tagerud said:

Hi! Is there any listbox like the one in the vista start menu?

It's not exactly the same. But if you are using Visual Studio 2008, there are quite a few menu's to choose from in there, that can act a little like the Start Menu in Vista. Whether they would work in the program you are wanting them for, I don't know.

As Vista is written mostly in C and C++, it will have been created using one of those.

Could you be more specific about your program? (If that's why you were asking :D)

#3
hampus.tagerud

hampus.tagerud

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
It is an applauncher. I want it to display the programs in a listbox, kinda like the one in vista (select an item when the mouse is moving on it and 1 click to start the selected app) but the standard listbox is not looking like vistas, vistas has rounded edges and a brighter blue color as selection while visual studios standard listbox just fills the row with plain blue color!

Is there any control to achive this or do I have to create a listbox on my own?**
I hope it became a little clearer!!

#4
ArekBulski

ArekBulski

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,376 posts
Mhm, so you are looking only for a control that displays items, no file-folder processing included. Since that "list thing" displays icons, I guess it is actually a ListView control. ListView Class (System.Windows.Forms)

There is something else, that some controls have. I think it was called HotTracking or something, that you can switch from "click selects doubleclick activates" into "move selects click activates". Maybe it is called otherwise. (Me falls asleep before pc)

#5
gaylo565

gaylo565

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 268 posts
I made a whole start bar like the windows start bar except it always stays on top of the original. This has all of the quick launch menus for my work projects as well as keeps track of which poject I am signed into and how much time I have logged in on each project. I found that in order to get the list to populate upwards like a vista menu bar and to add my own icons I had to make my own custom control. I am not sure what you are going for here but If you want something that differs from a regular listbox or listview to much, it may be eisier to make your own control. When you are looking to make a control look a certian way or behave a certain way, and it isn't the intended look or behavior, then you will probably need to make your own control. Im sure with a little photo shop work you can make it look pretty close to a native vista listbox.

#6
hampus.tagerud

hampus.tagerud

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
Any sources for how to create a listbox control? I have never done a custom control before!

gaylo565: how did you get your menu above the original start menu? Is it shown when you click the start menu? That sounds like a very interesting feuture!

#7
gaylo565

gaylo565

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 268 posts
In order to create a custom control just start with a blank Windows form and then think of how you would like it to behave and most of the programming is pretty easy from there.

For a listbox you need to add a scroll bar to one side, picture box(s) for creating a custom look, and a label or something for holding the selection options for you list (I like to just add a label to hold text while in the IDE but some prefer to actually add this dynamically with the population of the list in order to make sure that the container is appropriate for what needs to be displayed.) Next you need to populate the list with the proper items and resize the form to fit the items in the list. This is usually on the actuall click handler so that when someone expands menu they see the proper items listed.

Make sure you change the properties of your form around so that they mesh properly with the control you are trying to come up with (With some modification of your properties you can make the form look like you need; for example getting rid of the title bar). You also will need to create some click handlers in order to keep the form on top when the mouse is scrolled over it, and vice versa if you prefer, as well as to handle any selections made by the user. Finally you can photoshop bitmaps to use to give your control the desired look. These will need to be added to the project in the proper location. These images need to be added to the form (usually using picture boxes) when the custom listbox populates so that you get your desired vista look. If you need different sections of one picture to behave differently just add some rectangles and seperate event handlers for the rectangles. Make sure that your text is set to display on top of the picture boxes so that all of the functioning parts of your control are easy to see/use.

I realize this is quite a bit of code once you actually get it all up and going, but in the end it will be easier than trying to modify an existing control to look/act like you need. I will try and post some code for an exsisting control I have made that might be similar to what you need, but it could take a little while, as I am at work right now, and don't have much access to some of my source code;) Hope this will help you out though. If you have any issues there are some good tut's on creating custom controls out there so dont be shy to check them out and see what you come up with. Good luck and plz post any more q's you come accross.