Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42441

VS 2008 Text Renderer Class For Arabic Script Languages

$
0
0
By default .Net Toolstrip control not render the text for RightToLeft languages correctly, I written a class to do so. All is well else after drawing graphics all the menus of toolstrip which are containing "&" not render correctly. Any help will be appreciated.

Attachment 93101

Here is the class.

PHP Code:

Namespace UrduTextRendrer
    
Public Class UrduTextRendrer
        Inherits ToolStripProfessionalRenderer
        
Protected Overrides Sub OnRenderItemText(ByVal e As ToolStripItemTextRenderEventArgs)
            
Dim sf As New StringFormat()
            If (
e.TextFormat And TextFormatFlags.RightToLeft) <> 0 Then
                sf
.FormatFlags StringFormatFlags.DirectionRightToLeft
            End 
If
            
Using brush = New SolidBrush(e.TextColor)
                
e.Graphics.DrawString(e.Texte.TextFontbrush, New RectangleF(e.TextRectangle.Locatione.TextRectangle.Size), sf)
            
End Using
        End Sub
    End 
Class
End Namespace 


Usage
PHP Code:

ToolStripManager.Renderer = New UrduTextRendrer.UrduTextRendrer 

Attached Images
 

Viewing all articles
Browse latest Browse all 42441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>