Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use an Assign method
Message
From
14/09/2002 09:05:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00700481
Message ID:
00700490
Views:
10
>Hi.
>I have a form with a no. of conrols on it e.g.
>Text1
>Text2
>Text3 whose control source are fields on a file.
>
>I want to set up an assign method for some of these contols so that when a value is changed, something happens.
>
>When I go into Form properties and try to set up a new property called Text1 , it says its already there
>
>If I set up a new method called Text1_asign, nothing happens
>
>Any ideas on what I am doing wrong ?
>
>Regards,
>
>Gerard

Gerard,
In order to add assign method you need to subclass the textbox control. ie:
define class myTextBox as Textbox
 procedure Value_Assign
 lparameters vNewVal
 * do something
 this.Value = vNewVal && Or reject - do not set
endproc
enddefine
However you don't need to create an assign method for value. There are already events that fire when you change value of textbox like InterActiveChange, ProgrammaticChange, Valid. And even LostFocus might be what you need.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform