Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox selected item outline
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Listbox selected item outline
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01424724
Message ID:
01424724
Views:
130
Hi everybody,

With this code

this.SelectedItemBackColor = this.ItemBackColor
this.SelectedItemForeColor = this.ItemForeColor

the selected item looks almost "normal" except that is has dotted outline around it. How can I get rid of it as well?

And also, in the MouseLeave event I have this code:
LPARAMETERS nButton, nShift, nXCoord, nYCoord
this.CloseList()
And the CloseList method is
LOCAL lnTopIndex, lnI
lnTopIndex = 0

STORE "" TO this.cSelectedItems, this.cSelectedItemsList 

FOR lnI = 1 TO this.ListCount 
  IF this.Selected(m.lnI) = .t.
     IF m.lnTopIndex = 0
        lnTopIndex = m.lnI
     ENDIF

     this.cSelectedItems = this.cSelectedItems + ;
     					IIF(not EMPTY(this.cSelectedItems),",","") + this.ListItem[m.lnI,1]
     this.cSelectedItemsList = this.cSelectedItemsList + ;
     					IIF(not EMPTY(this.cSelectedItemsList),",'","'") + this.ListItem[m.lnI,1] + "'"
  ENDIF
NEXT

IF m.lnTopIndex <> 0
   this.TopIndex = m.lnTopIndex
ENDIF

IF NOT this.cCurrentlySelected == this.cSelectedItems 
   this.RefreshDependents(this.cSelectedItemsList) 
ENDIF

this.Height = this.nOriginalHeight

this.SelectedItemBackColor = this.ItemBackColor 
this.SelectedItemForeColor = this.ItemForeColor 

this.Value = this.Value
this.ZOrder(1) && Send to back
The effect I observe on my form is the following:

When this listbox is the first in the TabOrder and after opening the list I close it by moving the mouse out of it, my first selected item is not showing up as selected until I do something (set focus to another object).

It does work correctly for the lists down below in my form (e.g. when I leave them with the mouse the selected item is shown up right away).

Do you see what I may be missing here?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Reply
Map
View

Click here to load this message in the networking platform