orbs

RichEdit @TAB - how to set to 8 characters width?

12 posts in this topic

in Edit control, @TAB sends the caret to nearest multiple of 8 characters width. this is regardless of font size etc.

in RichEdit control, settings for @TAB is very confusing and messy. it does not depend on character width, but on other units of measures, such as cm,mm,pt and such. so i can't seem to find a way to set it the same way as in Edit control. i'm using monospace font, if that's of any use.

google offers no help, as any searches for "TAB" return results for a Tab control... :'(

any ideas?

i'm thinking of wrapping _GUICtrlRichEdit_AppendText() to replace @TAB with a computed amount of whitespaces that would match nearest 8-characters-width multiple... but there has to be a better way, i hope.

Share this post


Link to post
Share on other sites




NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

Post here an exmaple what you have tried.


NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

comments inside:

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

Global $hGUI = GUICreate('RichEdit @TAB width test', 320, 320, -1, -1)
GUISetBkColor(0xFEDCBA)
Global $hRichEdit = _GUICtrlRichEdit_Create($hGUI, '', 10, 10, 300, 300, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
_GUICtrlRichEdit_SetFont($hRichEdit, 9, 'Courier New')

_GUICtrlRichEdit_SetTabStops($hRichEdit, 0.6)
; 0.6 is the nearest guess to 8-characters-width of Courier New at size 9.
; it's not exact, and will stop working if i set different font size.
_GUICtrlRichEdit_AppendText($hRichEdit, '1234567' & @TAB & '1234567' & @TAB & '1234567')

GUISetState(@SW_SHOW)
While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

_GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
GUIDelete()

 

Edited by orbs

Share this post


Link to post
Share on other sites

Try this:

;~ https://www.autoitscript.com/forum/topic/185490-richedit-tab-how-to-set-to-8-characters-width/

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

Global $hGUI = GUICreate('RichEdit @TAB width test', 320, 320, -1, -1)
GUISetBkColor(0xFEDCBA)
Global $hRichEdit = _GUICtrlRichEdit_Create($hGUI, '', 10, 10, 300, 300, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
GUISetState(@SW_SHOW)

_GUICtrlRichEdit_SetFont($hRichEdit, 9, 'Courier New')

_GUICtrlRichEdit_SetSpaceUnit("pt")

; 0.6 is the nearest guess to 8-characters-width of Courier New at size 9.
; it's not exact, and will stop working if i set different font size.
_GUICtrlRichEdit_AppendText($hRichEdit, '1234567' & @TAB & '1234567' & @TAB & '1234567' & @CRLF)

MsgBox(0, '', 1)
_GUICtrlRichEdit_SetFont($hRichEdit, 12, 'Courier New')
_GUICtrlRichEdit_AppendText($hRichEdit, 'B234567' & @TAB & 'B234567' & @TAB & '1234567' & @CRLF)

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

_GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
GUIDelete()

 


NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

Your original script actually works. The TabStops works per inch, every X inch of the edit control is where the tab can fit, if there's 7 characters in that inch and then you add tab, the tab is only going to use the last 1 character position for its tab.

This isn't going to be exact because the TabStop function works in inches, which doesn't get as precise as millimeters or pixels (pixels would be ideal since that's what everything is measured in... but I'm guessing this is an outdated function, I don't really know)

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#include <FontConstants.au3>
#include <String.au3>

Global $hGUI = GUICreate('RichEdit @TAB width test', 420, 320, -1, -1)
GUISetBkColor(0xFEDCBA)
Global $hRichEdit = _GUICtrlRichEdit_Create($hGUI, '', 10, 10, 400, 300, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
_GUICtrlRichEdit_SetFont($hRichEdit, 9, 'Courier New')
Global $iCharPerTab = 8
Global $sMeausre = ""

For $i = 1 to $iCharPerTab
    $sMeausre &= $i
Next

_GUICtrlRichEdit_SetTabWidth($hRichEdit, $iCharPerTab)
_GUICtrlRichEdit_AppendText($hRichEdit, $sMeausre & @CRLF & _StringRepeat(" ", $iCharPerTab) & @CRLF & @TAB & @CRLF & $sMeausre)

GUISetState(@SW_SHOW)

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

_GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
GUIDelete()

; Sets the tab width based on how many characters wide you want it to be
Func _GUICtrlRichEdit_SetTabWidth(Const $hRichControl, Const $iWidth)
    Local $aDimensions = GUIMeasureString(" ", $hRichControl)
    If (Not @Error) Then Return _GUICtrlRichEdit_SetTabStops($hRichEdit, PixelToInch($aDimensions[0] * ($iWidth - 1)))
    Return SetError(1, 0, 0)
EndFunc

; Convert the pixels of how wide the tab character is to inches, which is what the TabStops function uses
Func PixelToInch(Const $iPixel)
    Local Static $iDpi = GetSystemDpi()
    ConsoleWrite(Round(($iPixel / $iDpi) * 2, 1) & @LF)
    Return Round(($iPixel / $iDpi) * 2, 1)
EndFunc

; Get the DPI of the system, this will be used to calculate how wide the tab character will be based on the system dpi
Func GetSystemDpi()
   Local $hDC = _WinAPI_GetDC(0)
   Local $iDeviceCaps = _WinAPI_GetDeviceCaps($hDC, $LOGPIXELSX)
   _WinAPI_ReleaseDC(0, $hDC)
   Return $iDeviceCaps
EndFunc

; Measure a string, used to get the width of the space character
Func GUIMeasureString(Const $vString, $iCtrlid = Default, Const $iSize = Default, Const $iWeight = Default, Const $iAttribute = Default, Const $sFontName = Default, Const $iQualiy = Default)
    Local $bCreatedId = False

    If ($vString = "") Then Return SetError(1, 0, $vString)

    If ($iCtrlid = Default) Then
        $bCreatedId = True
        $iCtrlid = GUICtrlCreateLabel("", -100, 0, 1, 1)
        GUICtrlSetFont($iCtrlid, $iSize, $iWeight, $iAttribute, $sFontName, $iQualiy)
    EndIf

    Local $hWnd = (IsHWnd($iCtrlid) ? $iCtrlid : GUICtrlGetHandle($iCtrlid))
    Local $iStringLen = StringLen($vString)
    Local $hDC = _WinAPI_GetDC($hWnd)
    Local $hFont = _SendMessage($hWnd, $WM_GETFONT)
    Local $hSelectObject = _WinAPI_SelectObject($hDC, $hFont)
    Local $tSize = _WinAPI_GetTextExtentPoint32($hDC, $vString)
    Local $aReturn[2] = [DllStructGetData($tSize, 1), DllStructGetData($tSize,2)]
    $tSize = Null

    _WinAPI_SelectObject($hDC, $hSelectObject)
    _WinAPI_ReleaseDC($hWnd, $hDC)

    If ($bCreatedId) Then GUICtrlDelete($iCtrlid)

    Return $aReturn
EndFunc   ;==>LongStringToArray

You could also just replace the tab character with 8 spaces yourself, whenever the tab key is pressed

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WinAPI.au3>
#include <WinAPIShellEx.au3>
#include <WindowsConstants.au3>

Global $hGUI = GUICreate('RichEdit @TAB width test', 420, 320, -1, -1)
GUISetBkColor(0xFEDCBA)
Global $hRichEdit = _GUICtrlRichEdit_Create($hGUI, '', 10, 10, 400, 300, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
_GUICtrlRichEdit_SetFont($hRichEdit, 9, 'Courier New')
Global $iCharPerTab = 8
Global $sTab = ""

Global $hNewWindowProc = DllCallbackRegister("NewWindowProc", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr")
Global $pNewWindowProc = DllCallbackGetPtr($hNewWindowProc)

For $i = 1 to $iCharPerTab
    $sTab &= ' '
Next

_GUICtrlRichEdit_AppendText($hRichEdit, 12345)

GUISetState(@SW_SHOW)
_WinAPI_SetWindowSubclass($hRichEdit, $pNewWindowProc, 9999)

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

_WinAPI_RemoveWindowSubclass($hRichEdit, $pNewWindowProc, 9999)
_GUICtrlRichEdit_Destroy($hRichEdit)
GUIDelete()

Func NewWindowProc($hWnd, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData)
    #forceref $hWnd, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData

    Switch ($iMsg)
        Case $WM_CHAR
            If ($wParam = 9) Then Return _GUICtrlRichEdit_InsertText($hRichEdit, $sTab)
    EndSwitch

    Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam)
EndFunc   ;==>KeyProc

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@mLipok, i don't see any difference between your example and the default behaviour of the RichEdit... the tab stops at same distance, regardless of font size. what are you trying to demonstrate?

 

@InunoTaishou

On 11/11/2016 at 7:02 PM, InunoTaishou said:

Your original script actually works ... This isn't going to be exact because the TabStop function works in inches

yes i know that, and that is exactly my problem.

On 11/11/2016 at 7:02 PM, InunoTaishou said:

You could also just replace the tab character with 8 spaces yourself, whenever the tab key is pressed

this i already mentioned as a possible solution, but it's not a constant 8 spaces, it has to be computed to the nearest 8-characters-multiple - i'd have to count how many characters exist from beginning of line until caret. and it will not be correct for long - if i add a character in there, then that calculation becomes invalid.

 

i really have no clue as to how to proceed.

 

EDIT: here's a better demo of the issue: i added a ComboBox by which you can change the font size and see how the spacing between TAB-separated substrings change:

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>

Global $hGUI = GUICreate('RichEdit @TAB width test', 520, 340, -1, -1)
GUISetBkColor(0xFEDCBA)

GUICtrlCreateLabel('Font Size:', 415, 9)
Global $gComboFontSize = GUICtrlCreateCombo('', 470, 5, 40, 20, $CBS_DROPDOWNLIST)
For $i = 6 To 14
    GUICtrlSetData($gComboFontSize, $i)
Next
Global $iFontSize = 9
GUICtrlSetData($gComboFontSize, $iFontSize)

Global $hRichEdit = _GUICtrlRichEdit_Create($hGUI, '', 10, 30, 500, 300, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
_GUICtrlRichEdit_SetFont($hRichEdit, $iFontSize, 'Courier New')

_GUICtrlRichEdit_SetTabStops($hRichEdit, 0.6)
; 0.6 is the nearest guess to 8-characters-width of Courier New at size 9.
; it's not exact, and will stop working if i set different font size.
_GUICtrlRichEdit_AppendText($hRichEdit, _
        '1234567' & @TAB & '1234567' & @TAB & '1234567' & @CRLF & _
        '12345678' & @TAB & '1234' & @TAB & '12' & @CRLF)
GUISetState(@SW_SHOW)
While True
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $gComboFontSize
            $iFontSize = GUICtrlRead($gComboFontSize)
            _GUICtrlRichEdit_SetSel($hRichEdit, 0, -1)
            _GUICtrlRichEdit_SetFont($hRichEdit, $iFontSize, 'Courier New')
            _GUICtrlRichEdit_SetSel($hRichEdit, 0, -1, True)
    EndSwitch
WEnd

_GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
GUIDelete()

 

Edited by orbs

Share this post


Link to post
Share on other sites
14 hours ago, orbs said:

i don't see any difference between your example and the default behaviour of the RichEdit... the tab stops at same distance, regardless of font size. what are you trying to demonstrate?

I misunderstood you.
Sorry.

On 11.11.2016 at 10:40 AM, orbs said:

google offers no help, as any searches for "TAB" return results for a Tab control.

Did you read this following pages:

http://stackoverflow.com/questions/154204/modifying-default-tab-size-in-richtextbox

https://www.experts-exchange.com/questions/10069878/Richedit-TabStops.html

https://www.experts-exchange.com/questions/20326576/RichEdit-Run-Time-Formatting.html

 

?

 


NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

ok, so after some thought, i made it to the conclusion that i'm thinking about it all wrong.

RichEdit is not an "enhanced" Edit control. i.e. it does not support all features of Edit, and adding upon it. rather, it is built from scratch with the notion that multiple objects should coexist comfortably (fonts, sizes, colors, images, etc.). so in that sense, it makes a lot of sense to define tab stops in absolute length, rather than related to character width.

i withdraw my attempts to use character width as a tab stop. for my specific needs, i wanted a RichEdit to support color highlight. fortunately, i can forfeit that. so i will revert the code to use "poor" Edit control.

sorry for sending you on a wild goose chase.

Edited by orbs

Share this post


Link to post
Share on other sites

#11 ·  Posted

Richedit can do color highlighting

Might get you started on how you want to do what you want. I did this a while ago when I was messing with the Richedit control and wanted an easy way to do some custom fonts/sizes/colors in a richedit using HTML tags.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

8 hours ago, orbs said:

RichEdit is not an "enhanced" Edit control

RichEdit is rather full editor like WORD , TxTextControl, PDF (in some sense).

 

Edited by mLipok

NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

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