Advertisement
3_2004-2005 String Manipulation #131163

Change Color Of a Piece Of String In RichTextBox Without Flashing In It

Hi All .. This Function Solve Problm Of Flashing During Change the Color of a Piece of String in RichTextBox .. It's Useful For CodeBoxes ..

AI

AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

源代码
original-source
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Function ColorRtfString(ByVal SelStart As String, ByVal SelLength As Long, ByVal Color As Long)
Dim OldPos As Long
Call LockWindowUpdate(RichTextBox.hWnd)
'Locking Editing (It Ignores Flashing )
OldPos = RichTextBox.SelStart
RichTextBox1.SelStart = SelStart
RichTextBox1.SelLength = SelLength
RichTextBox1.SelColor = Color
RichTextBox1.SelStart = OldPos
RichTextBox1.SelLength = 0
'Unlocking Editing 
Call LockWindowUpdate(0)
End Function
原始评论 (3)
从 Wayback Machine 恢复