Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To: Hijack the Column.Init() from Column.txtbox.init
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00774641
Message ID:
00777101
Vues:
19
Thanks for responding and sorry to reply late. That is what I was thinking about doing, but I would like to put in as a class code so I don't have to do it for all instances. I use visual classes, not much of a PRG guy for classes.

>Yes, I understand now. Your setting is external to the alias, so DynamicInpurMask won't work. Have you tried moving the code to the column's init?
>
>Alan
>
>>Yes that is okay I would like to use DynamicInputMask but it so happens that this property becomes blank of if manually populated at design time will not take effect. As soon as the focus leaves this column the picture returns to the default for currency.
>>
>>>If you're trying to change the default input mask of the column from the contained textbox init event, then it's too early. Since the textbox initialises before the column does, I don't see how this could work. I think you'll have to find a better place to put the code. Why can't you run the code from the column's init() instead and have it change it's own input mask? At that point, all the contained textbox information is available to it.
>>>
>>>Maybe it would even be better to try using the column's DynamicInputMask property to handle changes more automatically.
>>>
>>>Alan
>>>
>>>>Hi all
>>>>
>>>>How can I set the InputMask of the column programatically from a textbox which is contained in this column. What is happening is that the InputMask at the time of Column.Init() takes over the this.parent.InputMask specified by the textbox.init(). The below codes though does not fail is serverly delayed in execution for it to work:
>>>>
>>>>textbox.init():
>>>>
LOCAL llRetVal
>>>>
>>>>DO CASE
>>>>	CASE "amount"$LOWER(THIS.COMMENT) OR "amt"$LOWER(THIS.COMMENT)
>>>>		THIS.INPUTMASK = goApp.GetSetting("General", "Amount Format", "99,99,99,999.99")
>>>>
>>>>	CASE "quantity"$LOWER(THIS.COMMENT) OR "qty"$LOWER(THIS.COMMENT)
>>>>		THIS.INPUTMASK = goApp.GetSetting("General", "Quantity Format", "9,99,99,999.999")
>>>>
>>>>	CASE "rate"$LOWER(THIS.COMMENT)
>>>>		THIS.INPUTMASK = goApp.GetSetting("General", "Rate Format", "99,99,999.9999")
>>>>ENDCASE
>>>>
>>>>IF THIS.PARENT.CLASS = "Column"
>>>>	THIS.PARENT.INPUTMASK = THIS.INPUTMASK
>>>>ENDIF
>>>>
>>>>llRetVal = DODEFAULT()
>>>>
>>>>RETURN llRetVal
>>>>
>>>>What IMO happens is that the column is already init()ed and the InputMask, if any, specified in the column takes precedence in the display and any further modifications, as in this case, to the Column.InputMask doe not have any effects.
>>>>
>>>>I use drag-n-drop of grid and it's column. Though I have worked on a grid builder which replaces the textboxes with the textboxes from my library, how to go about hijaking column classes.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform