Click to See Complete Forum and Search --> : Multi column Combo !


Ravi Kiran
March 25th, 1999, 03:21 AM
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!.

Chris Eastwood
March 25th, 1999, 03:39 AM
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

Ravi Kiran
March 25th, 1999, 05:04 AM
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

Chris Eastwood
March 25th, 1999, 06:00 AM
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

Ravi Kiran
March 25th, 1999, 06:47 AM
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

Chris Eastwood
March 25th, 1999, 07:58 AM
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