-
old doog new trick with on key label
I have a form with lots of subclassed controls. Customer wants to now add a
change to a global filter ON/OFF by pressing F4
In the old days :
on key label F4 do set_filter
Today I created a method on the form to check the status, change it, then
change the label showing the status.
This is in the init of the form:
on key label f4 this.chg_filter()
It bombs telling me that THIS, or THISFORM can only be used in a method.
Any ideas. Putting the call in all the combo box keypress event is not what
I have in mind.
TIA
-
Re: old doog new trick with on key label
You should use the form's KeyPress event instead of ON KEY LABEL. Don't
forget to also set the form's KeyPreview property to .T.
If you really, really want to, you can still use the ON KEY LABEL command.
You just can't use "this" or "thisform" in it. You have to specify it as
"_SCREEN.ActiveForm...."
Fred
Stephen Russell wrote in message <390f2ca2$1@news.devx.com>...
>I have a form with lots of subclassed controls. Customer wants to now add
a
>change to a global filter ON/OFF by pressing F4
>
>In the old days :
>on key label F4 do set_filter
>
>Today I created a method on the form to check the status, change it, then
>change the label showing the status.
>
>This is in the init of the form:
>on key label f4 this.chg_filter()
>
>It bombs telling me that THIS, or THISFORM can only be used in a method.
>
>Any ideas. Putting the call in all the combo box keypress event is not
what
>I have in mind.
>
>TIA
>
>
-
Re: old doog new trick with on key label
Steve,
Rout it to a hook PRG instead of a method. That's the only way OKL's will
work. They don't like methods.
------------
John Koziol
MS MCSD, MVP Visual FoxPro
Stephen Russell <srussel3@midsouth.rr.com> wrote in message
news:390f2ca2$1@news.devx.com...
> I have a form with lots of subclassed controls. Customer wants to now add
a
> change to a global filter ON/OFF by pressing F4
>
> In the old days :
> on key label F4 do set_filter
>
> Today I created a method on the form to check the status, change it, then
> change the label showing the status.
>
> This is in the init of the form:
> on key label f4 this.chg_filter()
>
> It bombs telling me that THIS, or THISFORM can only be used in a method.
>
> Any ideas. Putting the call in all the combo box keypress event is not
what
> I have in mind.
>
> TIA
>
>
-
Re: old doog new trick with on key label
We dunt need no stinkin program!
Thanks. I fooled it via _screen.activeform.my_method
I'm going to try the forms keypress event but I've got other hotter fish to
fry now.
When are you getting to NO? I think we need to get together over a drink or
two.
__Stephen
"John Koziol" <i486dx@prodigy.net> wrote in message
news:390fafce@news.devx.com...
> Steve,
>
> Rout it to a hook PRG instead of a method. That's the only way OKL's will
> work. They don't like methods.
>
> ------------
> John Koziol
> MS MCSD, MVP Visual FoxPro
>
>
>
>
> Stephen Russell <srussel3@midsouth.rr.com> wrote in message
> news:390f2ca2$1@news.devx.com...
> > I have a form with lots of subclassed controls. Customer wants to now
add
> a
> > change to a global filter ON/OFF by pressing F4
> >
> > In the old days :
> > on key label F4 do set_filter
> >
> > Today I created a method on the form to check the status, change it,
then
> > change the label showing the status.
> >
> > This is in the init of the form:
> > on key label f4 this.chg_filter()
> >
> > It bombs telling me that THIS, or THISFORM can only be used in a method.
> >
> > Any ideas. Putting the call in all the combo box keypress event is not
> what
> > I have in mind.
> >
> > TIA
> >
> >
>
>
-
Re: old doog new trick with on key label
Stephen,
Now try pressing the funtion key while your form doesn't have focus, and bam
you've got a big problem.
The best solution by far is to encapsulate this functionality to the
KeyPress() method of the form.
--
df - (Microsoft FoxPro MVP) http://www.geocities.com/df_FoxPro/
"Stephen Russell" <srussel3@midsouth.rr.com> wrote in message
news:39109250$1@news.devx.com...
>
> Thanks. I fooled it via _screen.activeform.my_method
>
> I'm going to try the forms keypress event but I've got other hotter fish
to
> fry now.
>
> When are you getting to NO? I think we need to get together over a drink
or
> two.
-
Re: old doog new trick with on key label
If I told you that every f'n form is modal in this app then I'd get on the
change over right away! But it's someone elses baby and I am just enhancing
it. Actually for the industry it's pretty good idea for modal. Users are
Mouse Impared, so everything is keyboarded.
thanks for the heads up though.
__Stephen
"David Frankenbach" <sendnospam@worldnet.att.net> wrote in message
news:3910c932@news.devx.com...
> Stephen,
>
> Now try pressing the funtion key while your form doesn't have focus, and
bam
> you've got a big problem.
>
> The best solution by far is to encapsulate this functionality to the
> KeyPress() method of the form.
> --
> df - (Microsoft FoxPro MVP) http://www.geocities.com/df_FoxPro/
>
> "Stephen Russell" <srussel3@midsouth.rr.com> wrote in message
> news:39109250$1@news.devx.com...
> >
> > Thanks. I fooled it via _screen.activeform.my_method
> >
> > I'm going to try the forms keypress event but I've got other hotter fish
> to
> > fry now.
> >
> > When are you getting to NO? I think we need to get together over a
drink
> or
> > two.
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks