Posted 16 years ago by Mark Vrankovich
Avatar
Hi there

When I programmatically set the Opacity property on my main form (that contains a SyntaxEditor) to anything but 1.0 (or 100%) the SyntaxEditor goes transparent, but it stops functioning correctly: the cursor disapears, it draws some text, but not all, etc...

However it seems to be OK if I set my main form to say 50% Opacity in the VS2008 properties editor and then run my application. It only seems to be a problem when setting the Opacity programmatically.

I am using the lastest version of SyntaxEditor for WinForms.
What can I do to get this working?

Comments (4)

Posted 16 years ago by Mark Vrankovich
Avatar
In addendum:

If I programmatically set the containing form's Opacity and then create a SyntaxEditor, then it works fine.

It seems only to be a problem when changing Opacity on an existing SyntaxEditor.

Also if I have a Syntax editor created after the forms Opacity has been set,
then I programmatically move the main form's Opacity from say 40% from 60% Opacity - then all is well.
But if I programmatically move the main forms Opcaity from 40% to 100%, then to 99%, and then to say 90% - the problem then occurs with this new SyntaxEditor. Also, interestingly, on the move from 100% to 99% the SyntaxEditor goes completely black (this might be the trigger of the problem, because it happens with an existing SyntaxEditor too).

I am using Windows XP with all the latest service packs.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mark,

I did a test of setting it at run-time after the window was displayed and it worked fine for me. I tested with Vista and Aero enabled, and also with it disabled.

If there is a problem in XP then it may be an issue with our GDI drawing code (we use Windows APIs) and how Windows updates that based on the Opacity. The only thing I could suggest is calling this code to see if it helps:
editor.ResetDoubleBufferCanvas(true);

That will reset the double buffer, which may help with your issue.


Actipro Software Support

Posted 16 years ago by Mark Vrankovich
Avatar
Hi There

Thanks, that solved it nicely.

I had tried .Refresh() but not .ResetDoubleBufferCanvas()
Posted 16 years ago by Mark Vrankovich
Avatar
editor.ResetDoubleBufferCanvas(true)
The latest build of this product (v24.1.1) 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.