• Silverlight中用后台代码自定义Grid


    通过后台代码来自定义一个Grid

    //实例化一个Grid
                Grid grid = new Grid();
                //设置RowDefinition
                RowDefinition row1 = new RowDefinition();
                row1.Height = new GridLength(20);
                grid.RowDefinitions.Add(row1);
                RowDefinition row2 = new RowDefinition();
                row2.Height = new GridLength(80);
                grid.RowDefinitions.Add(row2);
    
                Button b = new Button();
                b.Height = 20;
                b.Width = 30;
                b.HorizontalAlignment = HorizontalAlignment.Right;
                b.Content = "关闭";
                b.Click += b_Click;
                //将Button添加到Grid中
                grid.Children.Add(b);
                //设置Button在Grid中的位置
                b.SetValue(Grid.RowProperty, 0);
    
                TextBlock txt = new TextBlock();
                txt.Text = "this is a test";
                txt.Height = 80;
                txt.Width = 200;
                //将TextBlock添加到Grid中
                grid.Children.Add(txt);
                //设置TextBlock在Grid中的位置
                txt.SetValue(Grid.RowProperty, 1);
  • 相关阅读:
    routing路由模式
    MQ的订阅模式
    RabbitMq中的消息应答与持久化
    work工作消息队列Round-robin与Fair dispatch
    040 关于hive元数据的解析
    simple简单消息队列
    用户设置与virtual host配置
    Mq的介绍
    字典
    元组Tuple
  • 原文地址:https://www.cnblogs.com/Gyoung/p/2805736.html
Copyright © 2020-2023  润新知