|
-
Sep 6th, 2002, 02:35 AM
#1
Thread Starter
Addicted Member
EM_HIDESELECTION & the RichTextBox
Hi, have found a huge amount of code in this forum dealing
with creating color syntax editors.The general concensus is not to
make one from scratch but to rather use/extend the RichTextBox
control for this purpose. Sample code provided by members such
as Megatron and BuggyProgrammer demonstrate the
fundamentals of syntax highlighting. Other members imroved
upon these basics with a wide variety of nice features.
There is one problem however that nobody seems to have
successfully addressed, and that is the visual flicker caused by
having to reformat text as the user is typing. Various attempts
to minimize this visual annoyance have been made with varying
degress of success (none of them completely successful). Some
examples include:
* Using the LockWindowUpdate () from the Win32 API.
* Only reformatting text which is not of the desired format.
* Reformatting the text in an offscreen buffer and 'streaming'
it back into the control.
These attempts are definately good attempts, but the end result
still lacks a professional looking quality. The flicker problem seems
to stem from automating the selecting (highlighting) of text (not
the actual reformating itself). I tried to test this hypothesis by
sending a EM_HIDESELECTION message to the control but it
seemed to have no affect. Upon further investigation (using
MS Spy++) I discovered that the control was simply not
interpreting EM_HIDESELECTION, thus leading me to believe
that VBs RichTextBox control is an extended RichEdit control
whose windowProc () is sending certain messages into a black
hole.
I would really like to know if anybody has found a solution
to this problem (or even a way to get the EM_HIDESELECTION
message to be recognized). I would also like to know if anybody
has had an positive experiences with creating a pure Win32
RichEdit control on a VB Form and making it useful (through
messages I would presume).
Thanks,
-CC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|