Results 1 to 3 of 3

Thread: MultilineListBox

  1. #1
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 05
    Location
    Lansing, MI; USA
    Posts
    3,786

    MultilineListBox

    With the help of NickThissen, I've put together an inherited ListBox control that allows the item's height to allow multiple lines of text be shown. Here are some properties to make note of:
    • DrawDivider (Boolean) - Determines whether a horizontal line is drawn between the items or not.
    • DividerColor (Color) - The color of the divider line.
    • DividerThickness (Single) - The thickness of the divider line.
    • MultilineEnabled (Boolean) - Controls whether the ListBox allows the item's height to grow to span multiple lines or not. If set to false the ListBox behaves like a normal ListBox except that a divider line may still be drawn between the items.
    Suppressed properties:
    • DrawMode - This is fixed at OwnerDrawVariable to allow the item's to be drawn multilined or normal.

    Name:  MultilineListBox.jpg
Views: 283
Size:  19.7 KB
    To use the control, simply add the MultilineListbox.vb file to your project, build the solution then use like any other control.
    Attached Files Attached Files
    Last edited by JuggaloBrotha; Apr 27th, 2010 at 03:16 PM.
    Currently using: VS 2010 Ultimate on Win7 Ultimate x64.



    CodeBank: All Threads • Colors ComboBox • Fading & Gradient Form • MoveItemListBox/MoveItemListView • MultilineListBox • MenuButton • ToolStripCheckBox • Start with Windows

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,655

    Re: MultilineListBox

    Does it work off of the wrapping of the text? Or is there a way to control it - say with an Environment.NewLine - I guess, how does one get an item to go multi-line?

    -tg


    Edit- oh, very cool by the way...
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  3. #3
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 05
    Location
    Lansing, MI; USA
    Posts
    3,786

    Re: MultilineListBox

    Right now, it's Environment.NewLine that controls it, no text wrapping but then again the FW ListBox doesn't do text wrapping either. However, if I get the time I can add it in somehow or if you or someone else wants to, feel free to.

    My next plan with it is to take this code and merge it with this: ListBox/ListView Move Item with Mouse so you can move the items around with the mouse even though they're no longer single lines of text.
    Currently using: VS 2010 Ultimate on Win7 Ultimate x64.



    CodeBank: All Threads • Colors ComboBox • Fading & Gradient Form • MoveItemListBox/MoveItemListView • MultilineListBox • MenuButton • ToolStripCheckBox • Start with Windows

Posting Permissions

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