We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

OnCustomDraw issue...

Thread ID:

Created:

Updated:

Platform:

Replies:

65601 Jul 26,2007 07:08 PM UTC Aug 2,2007 10:59 AM UTC WinForms 1
loading
Tags: EditControl
Sam
Asked On July 26, 2007 07:08 PM UTC

I am attempting to use the OnCustomDraw event to capitalize specific words from a list of lexems. However, there appears to be an issue in OnCustomDraw that causes it to fail if the .CaseInsensitive property of the edit control is set to TRUE.

Example:
Given a list of Lexems to syntax highlight, assume that the word "DEBUG" is set to highlight as BLUE.

By using the OnCustomDraw event, I can cycle through each lexem and compare it to the e.Text argument in OnCustomDraw to determine a match. If found, the word is capitalized as such:

For Each CL As ConfigLexem In EC.Language.Lexems
If CL.BeginBlock.ToUpper = e.Text.ToUpper Then
e.Text = CL.BeginBlock
End If
Next

If CaseInsensitive is set to FALSE, this works as expected and capitalizes any word that matches the lexem words. However, if CaseInsensitive is set to TRUE, OnCustomDraw fails to fire on a match *only*.

Is there an alternative to custom capitalization that can be done to bypass this issue? I've noticed that issues involving capitalization have been mentioned as being looked into over a year ago on the forums.....?

Ramya R [Syncfusion]
Replied On August 2, 2007 10:59 AM UTC

Hi Sam,

Thank you for your interest in Syncfusion Products.

Using the code snippet provided by you, though the CaseInsensitive property is set to false it doesn't work for me and the lexem words are not capitalized.


It works only after changing the code snippet as shown below,
For Each CL As ConfigLexem In EC.Language.Lexems
If CL.BeginBlock.ToUpper = e.Text.ToUpper Then
e.Text = CL.BeginBlock.ToUpper
End If

Using the above code snippet, I tested for the issue that you have mentioned here by setting CaseInsensitive property to true but I was not able to reproduce it. It works fine and the lexem words are capitalized.

Please let me know if I have misundertood your requirement.

Also please let me know if you have any queries.

Thanks & Regards,
Ramya.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;