Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAKE 'ON KEY LABEL' change active Textbox on form
Message
De
08/09/2001 08:46:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/09/2001 08:20:21
Ing. T.R.M. Pluym
Pluym Elektronics Bv
Hulst, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00554266
Message ID:
00554272
Vues:
10
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>I like to implement a function to the ALT-P key to activate the PROPER() function on the current active TextBox on the form.
>
>I already tried:
>
>ON KEY LABEL ALT+P MyProper(ThisForm.Activecontrol.Value)
>
>FUNCTION(tcValue)
>
>Proper(tcValue)
>
>RETURN(.T.)
>
>It dit not work because the 'ThisForm.' does only works on the form itselve.
>
>Wat is an other way to make this work ??
>
>Thanks in advance,
>
>Theo

Theo,
Assuming your function is just a skeleton and typo, you could use :
_screen.activeform.activecontrol.value

However I think what you really want to pass the object itself :
_screen.activeform.activecontrol

Or better pass nothing and function can check itself :
ON KEY LABEL ALT+P do MyProper()

function myProper
with _screen
if type('.activeform.activecontrol')='O' ;
 and type('.activeform.activecontrol.value') = 'C'
 with _screen.activeform.activecontrol
    .value = proper(.value)
 endwith
endif
But remember you could do this in textbox class (by adding GetKeyState API call). An easier way would be a command button with alt+p shortcut or menu option. On key label is almost obsolete.
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