Jump to content

howto: colored layer over updating EDIT control


Recommended Posts

Hi,

I'm trying to create a console reader. All is working but I have a problem with the look. I want the line numbers with another backgroundcolor in silver. I made this with a small silver label. The edit control over the label has a transparent background.

But if I start the prog then i can see how the line numbers wipe the silver background off. And if I click into the Edit then the silver label disappears completely.

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ColorConstants.au3>
#include <StaticConstants.au3>
#include <GuiEdit.au3>

Opt("GUIOnEventMode", 1)

Global $g_iZaehler = 0

Global $g_hGUI = GUICreate("Console: StdoutRead" , 800, 800, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPCHILDREN, $WS_EX_ACCEPTFILES)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

Global $text = GUICtrlCreateEdit("",10,30,780,760, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY + $ES_NOHIDESEL)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetFont(-1, 9, -1, -1, "Lucida Console")
GUICtrlSetResizing(-1, $GUI_DOCKBORDERS)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

Global $g_LaZeilen = GUICtrlCreateLabel("Zeilen: " & StringFormat("% 5d", $g_iZaehler), 680, 10, 100, 9, $SS_LEFTNOWORDWRAP)
GUICtrlSetFont(-1, 9, -1, -1, "Lucida Console")
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKSIZE)

Global $g_hCbFreeze = GUICtrlCreateCheckbox("&Freeze", 13, 5, 90)
GUICtrlSetFont(-1, 9, -1, -1, "Lucida Console")
GUICtrlSetResizing(-1, $GUI_DOCKALL)

GUICtrlCreateLabel("", 11, 31, 42, 758) ; soll die Ziffern andersfarbig hinterlegen
GUICtrlSetBkColor(-1, $COLOR_SILVER)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKBOTTOM + $GUI_DOCKWIDTH)

GUISetState(@SW_SHOW)

Global $sText = StringFormat("% 5d", $g_iZaehler) & @CRLF
_GUICtrlEdit_AppendText($text, $sText)

While 1
    Sleep(200)
    $g_iZaehler += 1
    $sText = StringFormat("% 5d", $g_iZaehler) & @CRLF
    _GUICtrlEdit_AppendText($text, $sText)
WEnd

Func _Exit()
    Exit
EndFunc

Do you have any suggestions.

Regards, Conrad

Edited by Simpel
SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

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

×
×
  • Create New...