Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set all Gotfocus and LostFocus to
Message
De
30/03/2005 10:24:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/03/2005 10:13:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Novell 5.x
Database:
Visual FoxPro
Divers
Thread ID:
00999921
Message ID:
00999932
Vues:
45
>>>Is there a way to change the code in all textbox gotfocus & lostfocus to this.backcolor= etc without going into each one and adding the code?
>>
>>In design mode? If so yes. Get references with aselobj() and use readmethod(),writemethod().
>>Cetin
>Yes this way would be great! Can you give me an example?

A quick one as its name suggests:)
* QuickAndDirtyBuilder.prg
local ix, lcMethodCode, lcMethodName
local array aObj[1]

lcMethodName = 'LostFocus'

text to m.lcMethodCode noshow
*Write your method code here
endtext
aselobj(aObj)
for m.ix=1 to alen(aObj)
  if lower(aObj[m.ix].baseclass == 'textbox'
    aObj[m.ix].WriteMethod(m.lcMethodName, m.lcMethodCode)
  endif
endfor
During design you might select the textboxes you want, go to command prompt:
modi comm QuickAndDirtyBuilder

Edit the code to your taste, select all, rightclick and 'Execute selection'.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform