日期:2014-05-18 浏览次数:21090 次
TextAlignment align = TextAlignment.Left;
switch ((this.cmbStyles.SelectedValue as ComboBoxItem).Tag.ToString())
{
case "左对齐":
align = TextAlignment.Left;
break;
case "居中":
align = TextAlignment.Center;
break;
case "右对齐":
align = TextAlignment.Right;
break;
}
TextAlignment align = TextAlignment.Left;
switch ((this.cmbStyles.SelectedValue as ComboBoxItem).Tag.ToString())
{
case "左对齐":
align = TextAlignment.Left;
break;
case "居中":
align = TextAlignment.Center;
break;
case "右对齐":
align = TextAlignment.Right;
break;
}
//将样式赋给富文本框的选中项
rtb_text.Selection.ApplyPropertyValue(Block.TextAlignmentProperty, align);