CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    7

    FileListBox-I want to set the multiselect property but..



    Hello,


    I want to set the file multiselect flag on my filelistbox or listbox at runtime - VB5.0 tells me this is a readonly property and that I can only change this property at design time. What is the work around to this? I really need the ability to set this property to 1 2 or 3 at runtime.


    Thanks, Terry

  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: FileListBox-I want to set the multiselect property but..



    This is a read only property at run time, because when your VB application starts, the API calls that create the listbox control have to specify the Multi-Select flag as part of the call. This style cannot be changed at run time.


    There are a few work arounds that spring to mind :


    1. Have 3 listboxes on the screen, all containing the same information. Each on will have a different 'select' property. When the user specifies 'multi' or 'single' select, display the relevant listbox over the existing one.


    2. Code some horrible workaround to make a 'multi-select' listbox act like a single select listbox (capturing mouse-up/click events) - a bit messy!


    Regards


    Chris Eastwood


    CodeGuru - the website for developers

    http://www.codeguru.com/vb

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured