Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ListBoxes
Message
From
12/01/2017 11:31:31
 
 
To
12/01/2017 09:08:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01646478
Message ID:
01646594
Views:
73
if you dont agree to go for grid this is a trick to solve your problem
*This is a replacement for absent horizontal scrollbar of listbox
* 2 methods : make the form.showtips=.t. and list.itemtips=.t. this permit to read entier line of listbox 
*(in a tooltip)if troncated.
*              resize the listbox as wanted to read its complet line (expand/collapse button).
*this is a test form for that

Publi oform
oform=Newobject("ylistbox")
oform.Show
Read Events
Retu
*
Define Class ylistbox as Form
	Top = 0
	Left = 0
	Height = 483
	Width = 770
	ShowWindow = 2
	ShowTips = .T.
	Caption = "Listbox Horizontal scrollbar replacements."
	width0 = .F.
	Name = "Form1"

	Add Object list1 As ListBox With ;
		RowSourceType = 6, ;
		RowSource = "ycurs.address", ;
		Height = 325, ;
		Left = 24, ;
		Top = 24, ;
		Width = 156, ;
		ItemTips = .T., ;
		Name = "List1"

	Add Object spinner1 As Spinner With ;
		Height = 24, ;
		Increment =   1.00, ;
		KeyboardHighValue = 4, ;
		KeyboardLowValue = 1, ;
		Left = 25, ;
		SpinnerHighValue =   4.00, ;
		SpinnerLowValue =   1.00, ;
		Top = 360, ;
		Width = 84, ;
		Value = 1, ;
		Name = "Spinner1"

	Add Object command1 As CommandButton With ;
		Top = 360, ;
		Left = 121, ;
		Height = 25, ;
		Width = 60, ;
		Caption = "Reset", ;
		BackColor = Rgb(128,255,0), ;
		Name = "Command1"

	Add Object check1 As Checkbox With ;
		Top = 396, ;
		Left = 35, ;
		Height = 17, ;
		Width = 103, ;
		AutoSize = .T., ;
		Alignment = 0, ;
		Caption = "List1.ItemsTips", ;
		Value = 1, ;
		Name = "Check1"

	Procedure Load
		Sele * From Home(1)+"samples\data\customer" Into Cursor ycurs
		*brow
	Endproc

	Procedure Destroy
		Clea Events
	Endproc

	Procedure list1.Init
		Thisform.width0=This.Width
	Endproc

	Procedure spinner1.InteractiveChange
		Thisform.list1.Width=Thisform.spinner1.Value*Thisform.width0
	Endproc

	Procedure command1.Click
		With Thisform
			.spinner1.Value=1
			.spinner1.InteractiveChange()
		Endwith
	Endproc

	Procedure check1.InteractiveChange
		With Thisform.list1
			.ItemTips=Iif(.ItemTips=.T.,.F.,.T.)
		Endwith
		If Thisform.list1.ItemTips=.T.
			Thisform.ShowTips=.T.
		Endi
	Endproc

Enddefine
*-- EndDefine:ylistbox
Previous
Reply
Map
View

Click here to load this message in the networking platform