Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange visual effect
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01017220
Message ID:
01017275
Views:
21
Here is the code from the button:
if YesNo("Are you sure you want to clear all accounts?")
	thisform.oSearchCollection.ResetControls()
	thisform.ChangeFormTitle('The search results were cleared')	
	thisform.cmdSelect.enabled = .f. && Nothing to select
	thisform.cmdSearch.enabled = .t. && New Search should be now available
endif
Code from the collection:
*---------------------- Location Section ------------------------
*   Library: 	Aformspatientvisitsearch.vcx
*   Class: 		Colsearchcntrls
*   Method: 	Resetcontrols()
*----------------------- Usage Section --------------------------
*)  Description: Resets the controls to blank
*)

*   Scope:      Public
*   Parameters:
*$  Usage:
*$
*   Returns:
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	11/28/2003 - JMW
*		MODIFIED
*----------------------------------------------------------------
local ji, lcControl

thisform.oBizobj.EmptySearchResult()

for ji = 1 to this.count
	lcControl = this.getkey(m.ji)
	= evaluate('this.parent.' + "o" + m.lcControl + ".ResetControls()")
endfor

this.SetFocusToFirst()
and this is EmptySearchResult() method of the biz obj:
*---------------------- Location Section ------------------------
*   Library: 	ASearchbiz.vcx
*   Class: 		Searchobject
*   Method: 	EmptySearchResult()
*----------------------- Usage Section --------------------------
*)  Description:
*)

*   Scope:      Public
*   Parameters:
*$  Usage:
*$
*   Returns:
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	01/12/2005 - NN
*		MODIFIED    05/18/2005 - NN
*----------------------------------------------------------------
local lnI
for lnI = 1 to alen(this.aTempAliases)
	if not empty(this.aTempAliases[m.lnI])
		use in select(this.aTempAliases[m.lnI])
	endif
next
dimension this.aTempAliases[1] && Reset the array
store "" to this.cWhereExpr, this.cJoinExpr
this.oBizRules.ClearAllRules()
this.oBizRules.ClearAllWarnings()
this.lNoRecordsSelected = .f.
this.nRecords = 0
zap in c_Search
Here is what I've noticed: if I do a search and it returns records, when I press Clear button, the grid is empty. But if I have an empty grid to begin with, the Clear button adds this blue line.

I can not figure out why this is happening.

>Are you using the ZAP command, or are you recreating the cursor?
>
>>Hi everybody,
>>
>>I have a grid on the form. The recordsource for the grid is a cursor, which is created in the Init method of the business object.
>>
>>When my form is instantiated, the grid is displayed empty. I also have a button on the form called Clear. When I press that button, I zap the cursor and refresh the grid. At this point there is a blue line displayed in the grid. I have set HighlightStyle to 2 for that grid. Why I have such strange visual effect?
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform