其实也就是个简单的tooltip生成,本人刚开始做wpf,不是什么高级应用
namespace UntitledProject1
{
public partial class Window1
{
public Window1()
{
this.InitializeComponent();
StackPanel sp = new StackPanel();
Label lb = new Label();
lb.FontWeight = FontWeights.Bold;
lb.Background = Brushes.Blue;
lb.Foreground = Brushes.White;
lb.Content = "检测结果";
sp.Children.Add(lb);
TextBlock tb = new TextBlock();
tb.Padding = new Thickness(10);
tb.TextWrapping = TextWrapping.WrapWithOverflow;
tb.Width = 200;
tb.Text = "都不通啊都不通";
sp.Children.Add(tb);
Line ln = new Line();
ln.Stroke = Brushes.Black;
ln.StrokeThickness = 1;
ToolTip的动态生成
最新推荐文章于 2024-06-24 08:00:00 发布