How to set TextOptions for a TextBlock in code behind in c# WPF? -


i adding dynamically generated textblock in code behind in wpf. need set following properties textblock in code behind not able so:

  • textoptions.textformattingmode="display"
  • renderoptions.bitmapscalingmode='nearestneighbor"
  • renderoptions.cleartypehint="enabled"

i cannot find them in code behind or way so. can please suggest how these properties can set in code ?

i looking same solution ... here :)

in case set properties richtextbox

richtxteditor.setvalue(textoptions.textrenderingmodeproperty, textrenderingmode.aliased) richtxteditor.setvalue(textoptions.textrenderingmodeproperty, textrenderingmode.auto) richtxteditor.setvalue(textoptions.textrenderingmodeproperty, textrenderingmode.cleartype) richtxteditor.setvalue(textoptions.textrenderingmodeproperty, textrenderingmode.grayscale)  richtxteditor.setvalue(textoptions.textformattingmodeproperty, textformattingmode.display) richtxteditor.setvalue(textoptions.textformattingmodeproperty, textformattingmode.ideal)  richtxteditor.setvalue(textoptions.texthintingmodeproperty, texthintingmode.animated) richtxteditor.setvalue(textoptions.texthintingmodeproperty, texthintingmode.auto) richtxteditor.setvalue(textoptions.texthintingmodeproperty, texthintingmode.fixed) 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -