Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Dropdown List Display Problems
Message
From
28/06/2001 09:14:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/06/2001 08:34:10
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00524611
Message ID:
00524632
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Cetin resolved an earlier issue (thread #524206) and gently clarified the difference between a Combobox and a Listbox to me :-), but now I'm having a heck of a time getting the columns to align correctly when the Combobox is clicked on. I'm combining fields in the SQL so the first column contains the information I need after selecting the item. I've tried using PADR, column width, string functions and different fonts to no avail. With a font like Arial the columns zig-zag around depending on the length of the field value (even when using PADR) and with fixed length fonts the dropdown becomes too wide, although they seem to be aligned straight.
>
>So, the gist of it seems to be that I can get a nicely aligned drop down if I don't mind having only the first field value displayed after selecting an item, or I can have a nicely displayed value of my combined fields after selecting, but the dropdown itself displays poorly.
>
>Is there a property having to do with the fonts or something that I'm not seeing? And, I'm used to being retold the obvious, so no feelings will be hurt in that arena either... Thanks!
>
>Regards, Renoir

Renoir,
With fonts, padr etc life is hard :) So a simple trick as I know the background.
Remember first column is combined and it'd be shown as combo text when an item is clicked. However remember we also included combined fields as separate fields too. It was like :

select code+field2+field3+field4, code,field2,field3,field4 from ...

For example using if it was lastname, firstname and birthdate a format like this would be suitable for rowsource :
select Lastname-(', '+Firstname-(' ['+transform(BirthDate)+']')), ;
 lastname, firstname, birthdate, keyid from myTable into cursor crsCombo
Rest is property setting :

Columncount = 4 && Don't want last keyid
Columnwidths = '0,80,80,80'

With 0 for first we suppress displaying of combined expr. when list is dropped. When clicked only combined shows.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform