I create TextBox on the Canvas like this:
TextBlock t = new TextBlock(); t.Foreground = new SolidColorBrush(...); t.FontSize = 10; t.HorizontalAlignment = HorizontalAlignment.Left; t.VerticalAlignment = VerticalAlignment.Top; t.Text = ...; Canvas.SetLeft(t, "f(width)"); Canvas.SetTop(t, ...); canvas.Children.Add(t); I want to know width of this TextBlock, because Left coordinate depends on this. Can I do it? ActualWidth is 0. Thanks.