,这个用VB怎么实现?
private Thickness _bdrThickness;// 单元格边框
/// <summary>
/// 重绘单元格时,嵌套两层Border用来分别显示右边框和下边框
/// </summary>
public override void Apply(Border bdr, SelectedState selState)
{
base.Apply(bdr, selState)
// 下边框
Border bottom = new Border()
bottom.BorderThickness = new Thickness(0, 0, 0, 1)
bottom.BorderBrush = _bdrThickness.Bottom == 1
? new SolidColorBrush(Colors.Black)
: new SolidColorBrush(Color.FromArgb(0xff, 0xe7, 0xe7, 0xe7))
// 右边框
Border right = new Border()
right.BorderThickness = new Thickness(0, 0, 1, 0)
right.BorderBrush = _bdrThickness.Right == 1
? new SolidColorBrush(Colors.Black)
: new SolidColorBrush(Color.FromArgb(0xff, 0xe7, 0xe7, 0xe7))
// 左边框和上边框放在最外面的主边框进行设置
if (_bdrThickness.Left == 1 || _bdrThickness.Top == 1)
{
bdr.BorderBrush = new SolidColorBrush(Colors.Black)
bdr.BorderThickness = new Thickness(_bdrThickness.Left, _bdrThickness.Top, 0, 0)
}
else
{
bdr.BorderThickness = new Thickness(0, 0, 0, 0)
}
UIElement content = bdr.Child
bdr.Child = bottom
bottom.Child = right
right.Child = content
right.Padding = bdr.Padding
bottom.Padding = _thicknessEmpty
bdr.Padding = _thicknessEmpty
} |
|