Hi @BitSmithy ,
Welcome to Microsoft Q&A!
This is really an unexpected behavior. After researching, this should be an issue of Canvas
, as other containers Grid, StackPanel are fine. After setting the width and height of the TextBlock
everything works fine.
TextBlock tbl = new TextBlock();
tbl.Text = "aaaaaaa";
tbl.TextAlignment = TextAlignment.Justify;
tbl.Width = 100;
tbl.Height = 50;
tbl.PointerEntered += Tbl_PointerEntered;
cnv.Children.Add(tbl);
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.