Using Measure to calculate size of a TextBlock
in wpf have been using code similar following size of textblock when wraps text within given size of box. go on position text relative other objects before rendering.
mytextblock.maxwidth = boxsize.width*0.9;
mytextblock.maxheight = boxsize.height*0.9;
mytextblock.measure(boxsize);
in silverlight desiredsize returns zero. is expected , there can size of a textblock before rendered?
thanks
nick
yeah, actualwidth/actualheight after setting text properties:
mytextblock.maxwidth = boxsize.width*0.9;
mytextblock.maxheight = boxsize.height*0.9;
mytextblock.font*** = xxxx
mytextblock.text = ...
size textblocksize = new size(mytextblock.actualwidth, mytextblock.actualheight);
-mark
silverlight program manager
microsoft
post provided "as-is"
Silverlight > Programming Silverlight with .NET – General
Comments
Post a Comment