RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 3409 | Replies: 7 | Thread Tools  Display Modes
Reply
Join Date: Jul 2007
Posts: 5
Reputation: gowri_itech is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gowri_itech gowri_itech is offline Offline
Newbie Poster

Multi column combobox

  #1  
Jul 10th, 2007
I need to place two columns within a single combo box.
But in VB, I found that we can place more than one column in list box by using columns property.
I dont know how to place more than one column in combo box.

Please help me on this.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Posts: 78
Reputation: manoshailu is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Help Re: Multi column combobox

  #2  
Jul 10th, 2007
hi,


U can use the tab or space for more than one column in combo box like this


combo1.additem("Apple" & vbtab & vbtab & "Mango")

or


combo1.additem("Apple" space(25-len("Mango")) & "Mango")


best regards
shailu.
Reply With Quote  
Join Date: Nov 2006
Posts: 799
Reputation: QVeen72 is on a distinguished road 
Rep Power: 4
Solved Threads: 110
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: Multi column combobox

  #3  
Jul 10th, 2007
Hi,

U can also use a Special NonPrintable Character like:

Combo1.AddItem ("1" & Chr(165) & "One")

When u need to Seperate them, use "Instr" Function

Regards
Veena
Reply With Quote  
Join Date: Jun 2007
Posts: 78
Reputation: manoshailu is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Help Re: Multi column combobox

  #4  
Jul 11th, 2007
Originally Posted by QVeen72 View Post
Hi,

U can also use a Special NonPrintable Character like:

Combo1.AddItem ("1" & Chr(165) & "One")

When u need to Seperate them, use "Instr" Function

Regards
Veena


hi veena,


chr(165) = ¥

while using chr(165), it looks some character is added in between two strings. But the requirement is to create two columns in the combo box so space or tab makes as two columns in the combo box.

regards
shailu
Reply With Quote  
Join Date: Jul 2007
Posts: 5
Reputation: gowri_itech is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gowri_itech gowri_itech is offline Offline
Newbie Poster

Re: Multi column combobox

  #5  
Jul 12th, 2007
Thank you for your suggestions. But a problem is first column char size is 255 and second col char size is 70. So We cant able to see the second column
Reply With Quote  
Join Date: Nov 2006
Posts: 799
Reputation: QVeen72 is on a distinguished road 
Rep Power: 4
Solved Threads: 110
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: Multi column combobox

  #6  
Jul 12th, 2007
Hi,

Better use a ListView Control or a MSFlexGrid Control. Users can Alter the ColumnWidth.

Regards
Veena
Reply With Quote  
Join Date: Jun 2007
Posts: 78
Reputation: manoshailu is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Re: Multi column combobox

  #7  
Jul 12th, 2007
hi,

I have attached a file with this. Copy the file to ur project and try.

In that file there could be one form and class module.

In that class module there could be a line

ret = ClientToScreen(Form7.Combo3.hwnd, pt)
Form7 - form name
combo3 - combo box name

change it as ur requirement.


while running ur form press the arrow key to view the columns in the combo box

al the best
Shailu
Attached Files
File Type: zip Combo.zip (4.5 KB, 69 views)
Reply With Quote  
Join Date: Jul 2007
Posts: 5
Reputation: gowri_itech is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gowri_itech gowri_itech is offline Offline
Newbie Poster

Re: Multi column combobox

  #8  
Jul 16th, 2007
Thank you. Its good
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:18 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC