EDIT Ghost-Text Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

effel
Posts: 544
Joined: 16 Jan 2018, 13:34

EDIT Ghost-Text

20 Mar 2021, 02:15

Hallo, kann man in AHK einem EDIT einen Ghost-Text hinzufügen, welcher beim ersten Tastendruck diesen gegen den zu schreibenden Text wechselt?


20210320080144-Monitor-3.jpg
20210320080144-Monitor-3.jpg (5.19 KiB) Viewed 740 times
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: EDIT Ghost-Text

20 Mar 2021, 02:46

Ich denke du solltest über die Farbgebung (und ein event) gehen.
Rohwedder
Posts: 7628
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: EDIT Ghost-Text

20 Mar 2021, 03:07

Missverständnis!
Last edited by Rohwedder on 20 Mar 2021, 04:06, edited 1 time in total.
just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: EDIT Ghost-Text  Topic is solved

20 Mar 2021, 03:47

Moin,

dafür gibt es eine spezielle Nachricht: EM_SETCUEBANNER.

Code: Select all

#NoEnv
Gui, Margin, 50, 10
Gui, Add, Edit, w200 vEDV hwndEDH
EM_SETCUEBANNER(EDH, "Schreib eine Nachricht")
Gui, Show, , EM_SETCUEBANNER
Return
GuiClose:
ExitApp

; ======================================================================================================================
; Sets the textual cue, or tip, that is displayed by the edit control to prompt the user for information.
; Text   -  the text to display as the textual cue.
; ======================================================================================================================
EM_SETCUEBANNER(HWND, Text) {
   ; EM_SETCUEBANNER = 0x1501 -> msdn.microsoft.com/en-us/library/bb761639(v=vs.85).aspx
   Return DllCall("SendMessage", "Ptr", HWND, "UInt", 0x1501, "Ptr", True, "WStr", Text, "Ptr")
}
User avatar
Gucky_87
Posts: 375
Joined: 03 Jul 2014, 05:09

Re: EDIT Ghost-Text

06 Apr 2021, 07:47

Das ist ja cool.
Ich habe so etwas bisher mit einem zusätzlichen TEXT Element gemacht, das, so lange das INPUT Element leer ist, angezeigt wird und an sonsten HIDDEN ist.

Gucky.

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 54 guests