Jump to content
Sign in to follow this  
LithiumLi

GUI Edit (Annoying Problem!)

Recommended Posts

LithiumLi

Hello

I am not doing so well today, I think I am not able to think because I am so sick :)

My second Autoit problem today is that when I run this example the edit box is Selected/Highlighted and I don't want it to be Selected/Highlighted because it ruins my script, I think it is "highlighting" my edit box because it is the only control so may be if I take focus away from it, it won't "highlight" it.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
GUICreate("Example", 250, 250)
GUICtrlCreateEdit("Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah", 0, 0, 250, 250)

GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
Dreamfire

Easy but effective,

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
GUICreate("Example", 250, 250)
GUICtrlCreateEdit("", 0, 0, 0, 0) ;; <<<<<<<<<<<<<<
GUICtrlSetState(-1, $GUI_HIDE) ;; <<<<<<<<<<<<<<
GUICtrlSetState(-1,$GUI_FOCUS) ;; <<<<<<<<<<<<<<
GUICtrlCreateEdit("Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah", 0, 0, 250, 250)

GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
LithiumLi

This works great but I wonder why I can't use

$GUI_NOFOCUS No Focus instead of Focus

instead, your way works great but is there a proper way of doing it anybody.

Edited by LithiumLi

Share this post


Link to post
Share on other sites
Dreamfire

This works great but I wonder why I can't use

$GUI_NOFOCUS No Focus instead of FocusoÝ÷ Ú)ìµæÊ«Á¬°¢¹,·µ»­Ëaz·¦º)z¼ÊÝ¢)à֧ɺËú®¢×²y¨bz0èrë(¬y鬶(®Gè®X¬¶øÂÆ®¶­sbb33c´uTôäôdô5U2Æ7GfWr6öçG&öÂvÆÂÆö÷6Rfö7W

Share this post


Link to post
Share on other sites
rasim

LithiumLi

Example:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

GUICreate("Example", 250, 250)

$cEdit = GUICtrlCreateEdit("Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah", 0, 0, 250, 250)

GUISetState(@SW_SHOW)

GUICtrlSendMsg($cEdit, $EM_SETSEL, -1, 0)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

:)

Share this post


Link to post
Share on other sites
crzftx

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
GUICreate("Example", 250, 250)
GUICtrlCreateEdit("", 0, 0, 250, 250)
GUISetState(@SW_SHOW)

GUICtrlSetData(-1, "Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah" & @CRLF & "Blah")

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.