Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use an Assign method
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00700481
Message ID:
00700505
Views:
9
Hi Gerard,

It is not possible to create methods on controls in the form designer. You must either subclass the Textbox or add the new method to your existing Textbox class with the class designer. My recommendation is to subclass the textbox and use my tool (NewClass in downloads) file:9955 to reassign the existing textboxes on your form to the new Textbox class.

Glenn

BTW Love your Beers!


>Glenn, thanks for your reply.
>
>With regard to the Assign method, is there a way of setting this up from the Form /class designer . I already have the TextBox set up as a class using the Class designer
>
>Regards,
>
>Gerard
>
>
>
>>Hi,
>>
>>Well it looks like you are trying to implement the "changed" events. Create a textbox Class which will support these events. Create a Textbox with a custom method called anyChange.
>>
>>
>>Define class TextWhichChanges as Textbox
>>
>>function InteractiveChange
>>this.AnyChange()
>>
>>function ProgrammaticChange
>>this.anychange()
>>
>>Function AnyChange
>>* Place your custom code here
>>
>>
>>If you must use an assign method...
>>
>>
>>Define class TextWhichChanges as Textbox
>>
>>function Value_Assign
>>* Place your custom code here
>>
>>
>>
>>Glenn
>>
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform