I am having troubles with RTL support in RichTextBox and WPF.
When I am trying to write using RTL the following sentence in RichTextBox - "9*11" the number flip sides between the astrik.
My keyboard is in hebrew mode
As you can see it is "11*9" and not "9*11", any ideas?
Have you changed anything in the properties of RichTextBox besides: FlowDirection="RightToLeft"?
Can you try with English Keyboard?
Related
I'm using a shared code to produce documents in Silverlight and WPF. But the output is different for the TextBlock alignment.
For example for a TextBlock of height 100, displaying a text in Arial with a FontSize of 100 :
In WPF the BaselineOffset is 92.16333
In Silverlight the BaselineOffset is 90.52667
This difference depends on the font family, for example if I replace Arial by Times New Roman :
In WPF the BaselineOffset is 91.23666
In Silverlight the BaselineOffset is 89,11
Is there a way to correct this behaviour and have the same alignment in WPF and Silverlight ?
Thanks for your help
Having worked in both WPF and Silverlight, I can confirm the rendering output of the same fonts at the same font size the output looks significantly different on screen.
In WPF you have a bit more control using RenderOptions i.e.:
RenderOptions.SetBitmapScalingMode(tb, BitmapScalingMode.NearestNeighbor);
RenderOptions.SetClearTypeHint(tb, ClearTypeHint.Auto);
RenderOptions.SetEdgeMode(tb, EdgeMode.Aliased);
You may need to play with values above to get as close as possible. Also as the renderoptions API is WPF only, if you're in a shared codebase you'd need to wrap it in a #if WPF directive..
I am experimenting with the WPF RichTextBox and it shows some text in my application. I notice that When I select some text in that RichTextBox, the selected text gets distorted and the text below to that also gets distorted as shown below.
After I deselect that and scroll it comes back to normal.Is there anyway to avoid this distortion?
Now I solved this problem by myself. I just added the following single line of code in my application and make it works. We need to disable hardware acceleration in screen settings using this.
RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
This helped me a lot to fix my issue and it works for me.
I'd like to scroll a mixture of text and pictures out to a debugging console written in WinForms.
For example, I might print a few lines of text, followed by a graph, followed by more lines of text, etc.
Is there some form of text box in WinForms that I can continuously append not only text, but also pictures or graphs?
You could consider a Rich Text Edit control. Here is a question whose answer links to some options. The question is old, so you may want to re-Google.
Open Source .NET Rich Text Editor UserControl with GUI all implemented
I have some Korean text I need to display on my WinForm. The text displays fine in my ListBox control. The same text does not display in my DropDownList control. Both controls have a font of Arial 8pt. The ItemHeight property for both controls is 14. I can't spot any differences in the properties of these controls that would mean one control displays the text correctly and the other doesn't.
I have read in the following article that the problem is either caused by the font or the character encoding.
From what I can gather, the code uses standard .NET strings. There are no character conversions taking place. The required font to display Korean must be installed, otherwise I would not be able to view it in one control and not another. What am I doing wrong?
I resolved this by changing the font from Arial 8pt to Arial Unicode MS 8.25pt. As Luis Quijada pointed out when he suggested I look at this question
ComboBox with Segoe UI and Japanese text
Changing the font from Arial to Arial Unicode MS was an acceptable workaround for me. I'm not sure which languages Arial is supposed to support. It's possibly a Microsoft bug that Arial works in the ListBox but not in the DropDownList for the Korean text.
With visual styles, i can use
VisualStyleElement.TreeView.Glyph.Closed
and VisualStyleRenderer to draw [+] button like in TreeView.
But when user have a "Classic" style in Windows, visual styles are not supported and I still need to draw this glyph.
It is still possible to use classes like
System.Windows.Forms.CheckBoxRenderer
but I haven't found anything like this for TreeView glyphs.
Yes, it is not possible to get that glyph. It is a simple one but you have to write the code. DrawRectangle and DrawLine. Or use a bitmap. Or make it look like the simple Vista triangles. Or don't enable ownerdraw when visual styles are off.