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. Image for the cookie policy date

OnCustomDraw issue...

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.....?

1 Reply

RR Ramya R Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon