當前位置: 首頁>>代碼示例>>C#>>正文


C# TextBlock.get_ActualWidth方法代碼示例

本文整理匯總了C#中System.Windows.Controls.TextBlock.get_ActualWidth方法的典型用法代碼示例。如果您正苦於以下問題:C# TextBlock.get_ActualWidth方法的具體用法?C# TextBlock.get_ActualWidth怎麽用?C# TextBlock.get_ActualWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Controls.TextBlock的用法示例。


在下文中一共展示了TextBlock.get_ActualWidth方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawCurveTitle

 private double DrawCurveTitle(Rectangle rc, PointData dpt1, PointData dpt2, string title, bool draw)
 {
     Point point3;
     Point point4;
     PointData data;
     Point point = this.PointData2Point(dpt1, rc);
     Point point2 = this.PointData2Point(dpt2, rc);
     if (point.get_X() < point2.get_X())
     {
         point3 = point;
         point4 = point2;
         data = dpt1;
     }
     else
     {
         point3 = point2;
         point4 = point;
         data = dpt2;
     }
     Color color = _SilverlightHelper.ConvertToColor(dpt2.Color);
     if (dpt1.DateTime > dpt2.DateTime)
     {
         color = _SilverlightHelper.ConvertToColor(dpt1.Color);
     }
     double rotationAngle = _SilverlightHelper.GetRotationAngle(point3, point4);
     TextBlock block = new TextBlock();
     int num2 = 100;
     double num3 = 5.0;
     block.SetValue(Canvas.TopProperty, point3.get_Y() + num3);
     block.SetValue(Canvas.LeftProperty, point3.get_X() + num3);
     block.SetValue(FrameworkElement.WidthProperty, (double) num2);
     block.SetValue(FrameworkElement.HeightProperty, 50.0);
     block.set_Width((double) num2);
     block.set_Text(title);
     block.set_FontSize(12.0);
     block.set_FontFamily(new FontFamily("Arial"));
     block.set_Foreground(new SolidColorBrush(color));
     block.set_FontStyle(FontStyles.get_Normal());
     block.set_FontWeight(FontWeights.get_Bold());
     RotateTransform transform = new RotateTransform();
     transform.set_Angle(-rotationAngle);
     block.set_RenderTransform(transform);
     block.set_TextAlignment(1);
     if (draw)
     {
         this.CanvasRoot.get_Children().Add(block);
     }
     return (block.get_ActualWidth() + num3);
 }
開發者ID:belsoft,項目名稱:traingraph,代碼行數:49,代碼來源:TrainGraphControl.cs


注:本文中的System.Windows.Controls.TextBlock.get_ActualWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。