Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: List Boxes?

  1. #1
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161

    List Boxes?

    I hope this isn't going to sound like a silly question.....

    I am writing my own front-end in VB.Net and would like to know what sort of 'list boxes' other front-ends use when displaying the play lists and when searching through directories etc. Is there a way of making a basic listbox look like these, or do you have to create your own 'control', made up of labels and some fancy code?

    Thanks for any help

  2. #2

  3. #3
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161
    Thanks for the quick reply. I have had a look at the RR source code, but I can't really understand how it works.

    I was thinking something along the lines of having about 10 Labels and a couple of buttons for page-up and page-down. I would load the relevant data (directories, mp3 files etc.) into an array and display 10 of these on the labels. When page-down is pressed, the text on the 10 labels is replaced by the next 10 items in the list.

    Is this how it is done, or is there a better way of doing it?

    Thanks in advance....

  4. #4
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,052
    Well if you put it all in a listbox, then all you have to do is scroll down. Labels can work, but what if you change the resolution. You will still only have 10 labels.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  5. #5
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161
    Yeah, I realize 'listboxes' will automatically adjust the amount of displayed lines when the text size is changed, but I don't want a Windows looking front-end, is there anyway to remove the vertical scroll bars of a 'listbox' and make your own page-up, page-down buttons? Also, is it possible to have different colour text on different lines of the listbox?

  6. #6
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,052
    Quote Originally Posted by portreathbeach View Post
    Yeah, I realize 'listboxes' will automatically adjust the amount of displayed lines when the text size is changed, but I don't want a Windows looking front-end, is there anyway to remove the vertical scroll bars of a 'listbox' and make your own page-up, page-down buttons? Also, is it possible to have different colour text on different lines of the listbox?
    Yes, Yes, Yes, I think so.

    .NET has the same "features" pretty much on VB.NET and C#.NET. I use C# mostly.

    I know in visual studio, you can just click the properties panel and disable vertical, horizontal, or both scrollbars.

    As for selecting manually I think the best way to do it, would be having a variable that stores how many items are shown at one time (and I say variable and not hardcoded because if you change the resolution, this number will change. Then have +/- 1 buttons (go up/down 1 item), as well as +/- VARIABLE_OF_ITEMS_IN_ONE_DISPLAY (go up/down that amount sort of like page up/down buttons). And when the selected item changes in .NET, it will move that item into view. You can enable/disable that too.

    As for changing the colour of each item, say I think so, because I think that list boxes can use rich text, and I know rich text you can individually code each character if you wanted to.

    If you don't want it windows looking then you might want to go with the label and changing the .text and then .update() all the label at once sort of thing. If you do it this way, you might want to only .update() the labels that are ontop and not in other panels/forms because it does slow it down a bit and in a big program it will matter and in an application where it will be playing music or displaying video you don't want jitters!
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  7. #7
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161
    Thanks for the advice. I have tried to disable the vertical scroll bar, but when the list gets bigger than the window, it automaticaly comes back. Maybe it's me being stupid, I'll guve it another go tonight.

    What you said about changing the text and updating the labels all in one go is the sort of thing I had in mind. I just wanted to know if there was an easier way of doing it. I'll have another look at listboxes.

  8. #8
    Variable Bitrate
    Auto Apps:loading...
    thekl0wn's Avatar
    Join Date
    Apr 2005
    Location
    PoCo, Indiana
    Posts
    284
    This is the portion I'm working on at the moment, as well. I'm making my own control, using labels. I've thought of the whole resolution issue, and haven't came up with a good solution, other than dynamically creating the labels, and label properties based on an integer which would be passed in. I'd like to see some other solutions as well.
    Play with it, 'til it's broke.

  9. #9
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    527
    I made my own listbox control in vb6.

    I add (and delete) labels based on the size of the usercontrol.
    I then use the amount of displayed labels to show my list.

    I'ts also made transparent using BitBlt api.

    This is close to what's being done in RoadRunner I think.

    Cheers
    Borte
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  10. #10
    Constant Bitrate
    Join Date
    Sep 2006
    Location
    Cornwall, England
    Posts
    161
    Yeah, this bit is tricky. Last night I managed to make a list box without scroll bars. I simply put the list box on a panel and made the listbox hang out the side, so the vertical scroll bar is not seen. I then used the PostMessage command to Page-Up and Page-Down the list box. It's OK, but still a bit crappy.

    I think I will end up using labels as my control as the blue selected item bar still looks crap, even if the rest of the control looks OK.

    When you make your controls out of labels, do you have the facility to change the font size after the control is initialized. ie. If you had 10 labels in your control and then changed to a larger fontsize, you would end up with labels close together or even overlapped text.

    Thanks again for the replies

Page 1 of 3 123 LastLast

Similar Threads

  1. Release new phoco integration preview
    By Robby BMW in forum Road Runner
    Replies: 544
    Last Post: 09-12-2009, 05:29 AM
  2. CUSTOM LISTS/ command list
    By liquid_smoke in forum Road Runner
    Replies: 2
    Last Post: 11-27-2006, 11:22 AM
  3. XM Station list is rather slow
    By DaveB in forum Road Runner
    Replies: 5
    Last Post: 03-15-2006, 12:57 PM
  4. thumbnail view for folder and list view for file?
    By civic5zigen in forum Road Runner
    Replies: 9
    Last Post: 11-01-2005, 12:55 AM
  5. "state of the art" parts list?
    By kbyrd in forum Newbie
    Replies: 13
    Last Post: 04-29-2005, 11:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •