Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop-down portion of combos
Message
From
23/08/2005 12:46:25
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01042920
Message ID:
01042990
Views:
27
This message has been marked as the solution to the initial question of the thread.
>>Hi everybody,
>>
>>Is there any way to control the width of the drop down portion of combobox? I'd like it to be the exact width as my combobox width is. How can I achieve it besides experimenting and adjusting?
>>
>>Thanks in advance.
>
>How does VFP control this internally? I have two comboboxes based on the same class, on the same field, which is 100 chars lons. However, the drop down portion in one combo is different than it's in another combo. I use the default non-proportional font, I don't want to switch to another font. Am I out of luck?
>
>Thanks.

run and resize the form
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


	Height = 250
	Width = 136
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT combo1 AS combobox WITH ;
		ColumnCount = 2, ; && it has to be upper to 1
		RowSourceType = 1, ;
		RowSource = "aaaaaaaaaaaaaa1,,bbbbbbbbbb2,,cc3", ;
		ColumnLines = .F., ;
		Left = 12, ;
		Top = 28, ;
		Width = 100, ;
		Name = "Combo1"


	PROCEDURE combo1.DropDown
		this.ColumnWidths = LTRIM(STR(this.Width-23))+',0'
	ENDPROC

	PROCEDURE resize
		this.combo1.width=MAX(0, this.width-24)
ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform