Sign in to follow this  
Followers 0
RocTx

$Get_Focus

4 posts in this topic

I may be missing something here, I'm just not sure. I get the error:

"Variable used without being declared" when trying to use $Get_Focus.

GUISetControlEx(-1,20)

$nInputCfn = GuiSetControl ("input", "", 50,45,100,20)

GUISetControlEx(-1,2,$GUI_FOCUS)

$nInputCln = GuiSetControl ("input", "", 200,45,100,20)

At first I had $Get_Focus by itself, when it did't work I added the line

GuiSetControlEx(-1,20) and still got the same error message. Aside

from that small piece the rest of my code works. What I'm trying to

accomplish is to get the focus (cursor) on the first Input filed of the form.

$nInputCln = GuiSetControl ("input", "", 200,45,100,20). Unless there is

another way and I'm just missing it.

Thanks for your responses.

Share this post


Link to post
Share on other sites



Did you do an: #include <GUIConstants.au3> at the top of the script?

This contains all the constants for the GUI commands...


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

No.. I had not added the "#include" line.

Thanks.. that cleared up the "Variable not declared" problem. But now, it doesn't

give me the focus on the field I want it be in. It don't get any focus unless I click

on the field.

Thanks JdeB...

Share this post


Link to post
Share on other sites

Figured it out.. My $input variable was not inside my $Get_Focus function.

Now it's in.. and it works. Great!

Thank for the tip JdeB..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0