Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox width
Message
 
 
To
13/11/2003 12:34:51
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00849510
Message ID:
00849603
Views:
40
This message has been marked as the solution to the initial question of the thread.
Ah, now I see. When I made the combo width 350, the column looked to be 269 because it was about 3/4 of the total with. When I configured the columnwidth to be 50, I saw that VFP was not respecting the settings.

This is wierd. Maybe Jim S. will chime in with something stating that this is by design and explain why.

IAC, you may have a workaround. In case you don't, the following changes should help:
THIS.cbo.ROWSOURCETYPE = 6
THIS.cbo.ROWSOURCE = "TypeOfTestCombo.OptionText,IdNr"
THIS.cbo.BOUNDCOLUMN = 2
THIS.cbo.CONTROLSOURCE = "Tests.teType"
THIS.cbo.COLUMNCOUNT = 2
THIS.cbo.COLUMNLINES = .F.
THIS.cbo.COULUMNWIDTHS = "269,0"
Changing the ColumnCount property to something other than 1 appears to "correct" the issue. If you turn off the column lines and make the second column width 0, it kinda gives you what you want.

HTH.

>I forgot to tell you that the width of the combobox is 350.
>i also thought that using the ColumnWidths property, I could resize the drop down column to exactly the size of the control. But as you see, the column width depends on the cursor field length.
>
>>Christian,
>>After running your code I don't see a problem. The display area for the combo values stretched well beyond the actual text of the values.
>>
>>The test was performed using VFP 8 SP1 on a WinXP Pro SP1 system.
>>
>>>Hello,
>>>
>>>Using VFP 8, I have the following problem with the combobox control. I set the following properties:
>>>
CREATE CURSOR TypeOfTestCombo(OptionText C(65), IdNr N(1))
>>>INSERT INTO TypeOfTestCombo VALUES ("Ingredient",1)
>>>INSERT INTO TypeOfTestCombo VALUES ("Packaging material",2)
>>>*
>>>THIS.cbo.ROWSOURCETYPE = 6
>>>THIS.cbo.ROWSOURCE = "TypeOfTestCombo.OptionText,IdNr"
>>>THIS.cbo.BOUNDCOLUMN = 2
>>>THIS.cbo.CONTROLSOURCE = "Tests.teType"
>>>THIS.cbo.COLUMNCOUNT = 1
>>>THIS.cbo.COULUMNWIDTHS = "269"
>>>What happens is that the drop down column width is much smaller than expected.
>>>It seems that the width of the column depends on the values in the cursor. Only when I use more than one column to display (ColumnCount=2,ColumnWidths="269,25"), then the column has the expected width.
>>>Is there a way to size the column width properly when using one column only?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform