Jump to content

GUI Edit (Annoying Problem!)


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

:)

Link to comment
Share on other sites

#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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...