Watermark in Editor???

SyntaxEditor for Windows Forms Forum

Posted 9 years ago by Ashton - Developer, Schema Solutions LLC
Version: 4.0.0284
Avatar
Is it possible in SyntaxEditor to show a watermark in the editor underneath the actual text?

Something similar to what you might see if you printed out something with the "DRAFT" watermark but actually centered in the editor on screen?

Thanks

Comments (3)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sure, if you inherit our VisualStudio2005SyntaxEditorRenderer class there are a whole bunch of Draw methods you can override to render before and after text is displayed. Use those and you should be able to achieve this effect.

Then set your renderer to the SyntaxEditor.Renderer property to use it.


Actipro Software Support

Posted 6 years ago by Robert Muir
Avatar

I tried inheriting from the renderer and overrode DrawTextAreaBackground, but it didn't work properly. I could draw on the editor, but once I scrolled the editor the drawing broke up completly and was unrecognizable.

I'd like to draw some text over the top of the text, and I'd like it positioned with respect to control - it shouldn't scroll with the text.

Any suggestions?

Thanks

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Robert,

Hmm.. it may be due to the way the WinForms editor does double buffering (and scrolling of the double buffer for best performance) that could be causing this.  I'm not sure of a way around that unfortunately other than if you make a separate control that sits above the SyntaxEditor in layout.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.