zoukankan      html  css  js  c++  java
  • dev listbox使用

    private void Init()
    {
    List<Funcation> data = new List<Funcation>();
    data.Add(new Funcation() { FunctionName = "测试窗体", FunctionKey = "DevDemoList.frmedit" });
    data.Add(new Funcation() { FunctionName = "RibbonForm窗体", FunctionKey = "DevDemoList.frmMain" });

    lsbFunction.DataSource = data;
    lsbFunction.DisplayMember = "FunctionName";
    lsbFunction.ValueMember = "FunctionKey";
    }

    private void listBoxControl1_Click(object sender, EventArgs e)
    {
    var SelectRow = lsbFunction.GetItem(lsbFunction.SelectedIndex) as Funcation;
    if (SelectRow != null)
    AddDocument(SelectRow);
    }

    选中的样式

    先设置属性

    private void lsbFunction_DrawItem(object sender, ListBoxDrawItemEventArgs e)

    {
    if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
    {
    e.Appearance.BackColor = Color.SkyBlue;
    e.Appearance.ForeColor = Color.White;
    }
    }

    设置行高 ItemHeight=26

  • 相关阅读:
    requests模块
    unitest模块
    doctest模块
    SessionStorage
    jquery选择器
    jquery操作dom
    jquery事件
    jquery筛选
    页面跳转传值接收
    HTML5 Web SQL 数据库操作
  • 原文地址:https://www.cnblogs.com/shuaimeng/p/9717429.html
Copyright © 2011-2022 走看看