Jump to content

Search the Community

Showing results for tags 'colorize'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I found this example by zedna, it worked perfectly (entering text into the control with specified color), that is until you add any form of line break (@CR, @LF or @CRLF). If the line breaks aren't there, the text entered is colored correctly, but when they are, the colors gets off and I can't figure out why, anyone know what's the matter? #include <GUIConstants.au3> #include <GuiRichEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 448, 269, 192, 124) $Edit1 = _GUICtrlRichEdit_Create($Form1,"", 16, 24, 417, 225) GUISetState(@SW_SHOW) _GUICtrlRichEdit_AppendTextColor($Edit1, "Hello "& @CR, "0x00FF00") _GUICtrlRichEdit_AppendTextColor($Edit1, "Autoit "& @CR, "0xFF0000") _GUICtrlRichEdit_AppendTextColor($Edit1, "World", "0x000000") ;~ _GUICtrlRichEdit_AppendText($Edit1, "World") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($Edit1) Exit EndSwitch WEnd Func _GUICtrlRichEdit_AppendTextColor($hWnd, $sText, $iColor) Local $iLength = Int(_GUICtrlRichEdit_GetTextLength($hWnd)/2) ; RichEdit stores text as 2 Byte Unicode chars _GUICtrlRichEdit_AppendText($hWnd, $sText) _GUICtrlRichEdit_SetSel($hWnd, $iLength, $iLength + StringLen($sText)*2) ; position in 2 Byte "Unicode" _GUICtrlRichEdit_SetCharColor($hWnd, $iColor) _GuiCtrlRichEdit_Deselect($hWnd) EndFunc
×
×
  • Create New...