Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Highlight a line in a listbox
Message
 
 
À
03/01/2006 10:15:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01082603
Message ID:
01082667
Vues:
12
>Hi all,
>I have a listbox with x elements, every line is on a white background. Is it possible to 'high light' serveral rows in the listbox or change the fond color ?
>
>thnx

Code from the multiselect listbox Refresh method:
********************************************************************
*  Description.......: List1.Refresh()
*  Calling Samples...:
*  Parameter List....:
*  Created by........: MDA
*  Modified by.......: Nadya Nosonovsky 01/18/2000 10:47:56 AM
********************************************************************
* 8/4/99: support pseudo-disablement of listbox.
*	Adapted from preliminary logic for handling the Counties listbox.
* 8/5/99: use alternate color (red) to distinguish exclusion from selection (blue).
* maintain pseudo-disablement of the listbox, even if parent.setall(...) disabled it
with this        
	if .parent.parent.visible && don't need to refresh if it's invisible	    
		.enabled = .t.		&& always keep the listbox actually enabled       
  
* fake up disablement of listbox so as to keep selections visible
		if .parent.enabled										&& parent container is enabled
* use default colors (I included all for clarity, but only two of these really change)
*!*	this.ItemBackColor = rgb(255,255,255)					&& white
			.itemforecolor = rgb(0,0,0)							&& black
			.selecteditembackcolor = ;
				iif(.parent.check1.value=1, rgb(128,0,0), rgb(0,0,128))	&& dark red or blue

		else														&& parent container is disabled
* use pseudo-disabled colors for the listbox
*!*	this.ItemBackColor = rgb(255,255,255)					&& white
			.itemforecolor = rgb(128,128,128)					&& gray
			.selecteditembackcolor = ;
				iif(.parent.check1.value=1, rgb(255,128,128), rgb(128,128,255))	&& light red or blue
*!*	this.SelectedItemForeColor = rgb(255,255,255) 			&& white
		endif
		dodefault()
	endif
endwith
You can also use grid instead. See Container with MultiSelectGrid File #9703
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform