Jump to content
Sign in to follow this  
FireLordZi

ControlFocus()

Recommended Posts

FireLordZi

If I wanted to set focus on a certain control such as an Edit control, would I do this:

ControlFocus("Find Player", "", "Edit1")

Assuming "Edit1" was the correct classnameNN.

If this is the correct way, how do I check if this control has focus or not? :D


While Alive() {
	 DrinkWine();
}
AutoIt Programmer

Share this post


Link to post
Share on other sites
Thatsgreat2345

This is the order.

Create Code > Test > Get Stuck > Look at Help File > Modify Code > Test > Get Stuck > Repeat() > After 10 times then post question. Okay so test it out, then tell use how it went. If you want to test if it has focus, and it is an edit start typing if it shows up where you set he focus ooooo it has focus.

Share this post


Link to post
Share on other sites
rasim

If I wanted to set focus on a certain control such as an Edit control, would I do this:

ControlFocus("Find Player", "", "Edit1")

Assuming "Edit1" was the correct classnameNN.

If this is the correct way, how do I check if this control has focus or not? :D

Thats not hard.

Run("notepad.exe")
WinWait("[CLASS:Notepad]")

Sleep(1000)

$Control = ControlGetFocus("[CLASS:Notepad]")

If Not $Control Then
    MsgBox(16, "Error", "Control not focused")
Else
    MsgBox(0, "", $Control)
EndIf

:P

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  

×