Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ColumnWidth Proprety in Combobox?
Message
From
21/08/2000 09:27:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00407261
Message ID:
00407274
Views:
20
>I have a combobox drop-down list based upon an array. Is there an easier way to set the ColumnWidth Property in pixels than guessing the width. For instance, I choose 100 pixels and see how everything looks/fits, then I choose 150 pixels and so on until I get a near-perfect fit for the rows of items in the combobox columns.
>
>I use Builder to set it for me automatically when I have a combobox based upon a Value, but I can't use that method for array based combobox values.
>
>What's the preferred way to set the ColumnWidth in pixels for an array-based combobox? Is there a magic formula I can use to estimate it based upon the maximum number of characters in a drop-down list row?
>
>Just wondering. I would like all my drop-down lists to look nicer width-wise. And I hate to waste time sizing my ColumnWidths if there is an easier/better way. TIA!


Steve,
There are more than one ways. Check txtwidth() for one. Another one is to create a label object temporarily and set its autosize to .t. and caption to longest text, get width and blow label.
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
Reply
Map
View

Click here to load this message in the networking platform