0

In my application i am displaying question in richtextbox. If question is plain text then it will display properly means in line but if question contain any mathtype equation or image it will not displayed properly.

I am attaching image file. I am used

rtxtque.SelectionAlignment = HorizontalAlignment.Left;

enter image description here but not any verticalAlignment property.

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
tung
  • 34
  • 2
  • Yes :( private void rtb_TextChanged(object sender, EventArgs e) { this.SelectAll(); this.SelectionAlignment = HorizontalAlignment.Left; this.DeselectAll(); } – tung Feb 28 '18 at 01:29
  • Have you tried to increase the font size? probably caused by the image size is greater than the font size. or there is some blank at the bottom of the image. – Sphinx Feb 28 '18 at 01:31
  • First check the same content in Wordpad. If wordpad is showing the content correctly, then [this post](https://stackoverflow.com/q/47433656/3110834) probably will solve the problem. But if the content is not showing properly even in wordpad, then the problem is probably because of the content. Also share a sample content. – Reza Aghaei Feb 28 '18 at 03:55
  • @Reza Aghaei The AdvancedTypographicsOption (those you have to enable using SendMessage with `EM_SETTYPOGRAPHYOPTIONS => TO_ADVANCEDTYPOGRAPHY`) which are used, for example, to enable Block Align (justification) are still disabled/not implemented in RichEdit50W. I posted [this method](https://stackoverflow.com/questions/37155195/how-to-justify-text-in-a-label/47470191#47470191) (which uses the "old" system) to re-enable it. Do you know another (.Net-ish) way to do it? – Jimi Feb 28 '18 at 14:16
  • @Jimi I'm not aware if `RichTextBox` supports this feature, but if I find any useful information about it, I'll share with you. – Reza Aghaei Mar 01 '18 at 03:00
  • @Reza Aghaei That would be great. RichEdit is a hell of a control. It's a shame that you cannnot take advantage of it's full potential without P/Invoking (which is not a good way for many). – Jimi Mar 01 '18 at 03:12

0 Answers0