Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Box Problem...Again

Status
Not open for further replies.

Creeder

Programmer
Jul 5, 2000
110
MY
Hi All,

I have a test form which consist of 1 textbox and 1 listbox. The listbox is populated with 5 items. When i click on the listbox it will highlight the item in blue.
However when i click on the textbox, the blue highlight is still in the listbox. How do i clear the hightlight?
The only solution which i stumble upon is do a THISFORM.list1.DisplayValue = '' which will clear the blue highlight.
Is this a bug or by design?

Thanks in advance.

Yue Jeen [sig][/sig]
 
I can answer your second question: it is by design.

Imagine you have a form, such as an order entry form. There are list boxes for Payment Type, Shipping Method, and Country of destination. The user chooses an item in each of these list boxes, then when they TAB out of them and proceed to the Save button, you'd certainly want to be able to visually review the screen and see what selections you've made. If they weren't highlighted after you exited, you couldn't tell what you had selected. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Hi Yue,

As FoxDev said, this feature is by design to signify to the user what he/she selected in the listbox when he/she moves to another control.

If you feel the blue highlight is unsightly or that it will confuse your users, simply change it in the Gotfocus/Lostfocus events of the listbox.

Example:

PROCEDURE MyListBox.GotFocus
THIS.SelectedItemForeColor=RGB(255,255,255) && default white
THIS.SelectedItemBackColor=RGB(0,0,128) && default blue
ENDPROC

PROCEDURE MyListBox.LostFocus
THIS.SelectedItemForeColor=RGB(0,0,0) && black
THIS.SelectedItemBackColor=RGB(255,255,255) && white
ENDPROC

This will set the appear to set the listbox back to it's initial state.

IMO, I would set the selecteditemforecolor to a color other than the listbox's itemforecolor property so it will be apparent to the user what selection he/she made after leaving the control.

For example, replace the code in red above, with the code below:
THIS.SelectedItemForeColor=RGB(255,0,0) [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
Hi Robert and Jon,

Thank you very much :)

Yue Jeen [sig][/sig]
 
Hi All,

I need to put footer on the report – 10 pre-calculated fields as summary to the report.
So it has to be only at the end of the report (fixed to the bottom) and if it’s enough space for 10 fields. If to put those fields in the ‘Summary’ group – how can I fix them to the bottom of the page? Footer calculated separately from the report and should be shown as one peace.

Can anyone help please?

Pete
 
Small Bo

You need to start a new thread for your question.

It has no relevance to the current thread.

I have taken the liberty of doing so for you in your name.

Chris

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top