zoukankan      html  css  js  c++  java
  • Silverlight Visifire控件 .net后台控制aspx页面控件的显示与隐藏,动态给控件赋值,选定默认值的设定

    .net后台代码:

    控件的显示与隐藏:

     this.dateStart.Visibility = Visibility.Collapsed;//不显示控件
     this.dateYear.Visibility = Visibility.Visible;//显示控件

    设置控件位置:

    this.oildomName.Margin = new Thickness(167, 12, 0, 0);
    this.oildomNameList.Margin = new Thickness(212, 12, 0, 0);
    this.btnQuery.Margin = new Thickness(322, 12, 0, 0);
    this.btnBack.Margin = new Thickness(407, 12, 0, 0);

     控件赋值,选定值的设定:

     for (int ii = DateTime.Today.Year; ii >= 1980; ii--)
     {
                        string item = string.Format("{0}年", ii.ToString());
                        // this.dateYear.Items.Add(item);
                        if (item != sClickReportDate)
                        {
                            this.dateYear.Items.Add(item);
                        }
                        else
                        {
                            ComboBoxItem cbi1 = new ComboBoxItem();
                            cbi1.SetValue(ComboBoxItem.ContentProperty, sClickReportDate);
                            this.dateYear.Items.Add(cbi1);
                            //下拉框赋选定值
                            this.dateYear.SelectedItem = cbi1;
                        }
    }

  • 相关阅读:
    mac下卸载mysql
    mac安装MySQL笔记
    mac安装python3.7.0
    web自动化测试之8大元素定位方法
    postman的下载和使用
    说说性能测试
    jmeter动态修改线程组参数
    服务器性能监控
    性能测试分配堆内存
    nmon分析工具的使用
  • 原文地址:https://www.cnblogs.com/xuxin-1989/p/3593432.html
Copyright © 2011-2022 走看看