Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fazer o valid dum spinner
Message
From
23/01/2003 06:06:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Fazer o valid dum spinner
Miscellaneous
Thread ID:
00744659
Message ID:
00744659
Views:
48
Pessoal

nos meus forms , tenho um botão para gravar , quando o utilizador faz click nesse botão , tenho que fazer o valid em primeiro lugar do objecto que tem o focus .
O proximo codigo , funciona bem quando o focus está num textbox , ou numa grid , mas não funciona quando está num spinner .
Peço ajuda das rapozas mais experientes ,

Um abraço


segue o código


****************
*** faz o Valid de todos os objectos que estão pendentes

with thisform

* code from 06/06/2002 Vlad Grynchyshyn
local oObj
if type('thisform.activecontrol.name')='C' .OR. type('thisform.activecontrol.name')='N'

oObj = .activecontrol
&& If it's a grid, we need to calculate the active control
if upper(m.oObj.baseclass) == "GRID"
nIndex = m.oObj.activecolumn
for i=1 to m.oObj.columncount
if m.oObj.columns(i).columnorder = nIndex
nIndex = i
exit
endif
endfor
oObj = m.oObj.columns(nIndex)
oObj = evaluate("m.oObj." + m.oObj.currentcontrol)
endif

&& Check if control has different value than its ControlSource
if ( proper(m.oObj.baseclass)='Textbox' .OR. proper(m.oObj.baseclass)='Spinner' ) ;
and not empty(m.oObj.controlsource) ;
and !(m.oObj.value==evaluate(m.oObj.controlsource))


m.oObj.value = m.oObj.value && Updated:NN: 06/07/02
lReturn = m.oObj.valid() && This is enough to write changes into ControlSource
if (vartype(m.lReturn)='N' and m.lReturn = 0) or m.lReturn = .f.
return .f.
endif

endif

endif

endwith


*** fim de faz o Valid de todos os objectos que estão pendentes
*******************************************************************


Pedro Silva

world is wonderful with your help .

Reply
Map
View

Click here to load this message in the networking platform