CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Multi column Combo !






    Hi Gurus,


    I am sorry if this question has been already asked & answered. If so please provide me the link.


    My question : How can i have a multi-column (like) drop-down combo box?

    I am fine with Win Api calls.


    More details if you like : The four columns are Date with Day, Time , Scan No( ie Record No) and Scan-File-id (if present).

    Though Date & day and Scan Nos not of same size always, Format$() can & does give string of const.lengths. But when i add this string to combo's list, it somehow compresses it. Const.Width fonts are solutions, but anything else..?


    I cant use a list box or ListView control because there is no place on the form.

    It is already cluttered!. I can afford only a combo!.



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

    Re: Multi column Combo !



    Hi


    I found a sample on the Net at


    http://www.zebra.net/~adrianm/pages/samples.htm


    Alhough I haven't downloaded it yet.


    You can also take a look at


    http://vbaccelerator.com/codelib/ddtoolwn/ddtoolwn.htm


    - which shows how to create a drop down window out of anything.


    Both of these examples require some knowledge of subclassing.


    Regards


    Chris Eastwood

    Codeguru - the website for developers

    http://www.codeguru.com/vb

  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Multi column Combo !





    Hi,


    I am sorry, if i sounded 'great' in my requirement :-).

    I was looking at something like a simple API call that will set the tab-stops in the DD-area of the combo box.


    You know that 'SendMessage' with appropriate values to set the Tab stops in a list box ( The values will be in 'dialog units') and then when you add a Tab formated string it will automatically allign the text.


    Is something like that possible for combo-box also?


    Ravi

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

    Re: Multi column Combo !



    Hi


    The ComboBox in VB has it's listbox control created at run-time. There's no way of intercepting that creation, or of changing the LBS_USETABSTOPS style of the listbox window (not that I'm aware of - you could *possibly* manage it with some really slimy subclassing tricks).


    A much better idea is mentioned at the two sites I gave you. The first one catches the dropdown event and then displays a listview as a child of the desktop - so allowing you to have multiple columns. The second site gives you the opportunity to have *any* control as a child of the desktop (popup window) with just a few lines of code.


    Regards


    Chris Eastwood


    Codeguru - the website for developers

    http://www.codeguru.com/vb




  5. #5
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Multi column Combo !





    Hi


    Thanks for the valuable links. I wanted similar effects for some other project!.


    I had done all the dirty work myself!, with a Form whose border style is zero

    positioned approp'ly etc. What was missing was that 'Desktop Parent' and consequently it had its own problems ( VB4.0) !


    I sure will look into this code. ( But, the first look says, this again referers to SSubTimer dll !!! ).


    Thanks again.

    Ravi

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

    Re: Multi column Combo !



    Hi


    The SSubTimer.DLL is Steve's (http://vbaccelerator.com) subclassing dll which he provides free on his site (with source code).


    Most of his samples utilise this DLL for subclassing - it's a very easy to use component which fits in nicely with the samples he gives. The only limitation on giving this away free is that if people recompile it - they do so under a different exe/ole name so that his samples will still work.


    Well worth investigating.


    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