WidthPercent

HorizontalRuleFormat.WidthPercent property

يحصل على طول القاعدة الأفقية المحددة أو يعينه معبرًا عنها كنسبة مئوية من عرض النافذة.

public double WidthPercent { get; set; }

استثناءات

استثناءحالة
ArgumentOutOfRangeExceptionيتم طرحه عندما تكون الحجة خارج نطاق القيم الصالحة.

ملاحظات

تتراوح القيم الصالحة من 1 إلى 100 شاملة.

القيمة الافتراضية هي 100.

أمثلة

يوضح كيفية إدراج شكل مسطرة أفقية وتخصيص تنسيقها.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertHorizontalRule();

HorizontalRuleFormat horizontalRuleFormat = shape.HorizontalRuleFormat;
horizontalRuleFormat.Alignment = HorizontalRuleAlignment.Center;
horizontalRuleFormat.WidthPercent = 70;
horizontalRuleFormat.Height = 3;
horizontalRuleFormat.Color = Color.Blue;
horizontalRuleFormat.NoShade = true;

Assert.True(shape.IsHorizontalRule);
Assert.True(shape.HorizontalRuleFormat.NoShade);

أنظر أيضا