zoukankan      html  css  js  c++  java
  • 标准控件(五)——Label,ListBox

    Label

        父类:WebControl

             在呈现的时候,两边会呈现为span标签。

    属性:

        Width                   (Unit)可设为像素,也可设为百分比

        Height                  (Unit)可设为像素,也可设为百分比

     

        BackColor               Color

        ForeColor               Color

     

        BorderColor             Color

        BorderWidth             Unit

        BorderStyle             BorderStyle

     

        Font:

            Bold

            Italic

            UnderLine

            OverLine

            StrikeOut

            Name:

            Size:

        CssClass                样式表的class

        Text                    标签上的文字

        ToolTip                 鼠标放上去的气泡信息。

        Enable                  是否可用

        Visible                 是否可见

     

     

    Literal也是一个标签:

        在呈现的时候,两边不会出现span标签。

     

     

    ListBox

        显示多个,选择多个。

    属性

        Items

        DataSource              数据源

        DataTextField           显示的内容

        DataValueField         

        SelectedValue           选中项的值

        SelectedItem            选中的对象(ItemTextValue属性)

        SelectedIndex           在集合中的下标序号

        AppendDataBoudItem      选择是否将数据绑定项追加到静态声明的列表项上

        SelectionMode           Single—单选;Multiple—多选

     

        获取选中项的值:

            foreach (ListItem li in ListBox1.Items)
            {
                if (li.Selected)
                {
                    Literal1.Text += li.Value;
                }
            }
  • 相关阅读:
    codeforces 269B Greenhouse Effect
    codeforces 5C Longest Regular Bracket Sequence
    codeforces 225C Barcode
    codeforces 279C Ladder
    CodeForces 479E Riding in a Lift
    CodeForces 351A Jeff and Rounding
    POJ-1579-201308122106.txt
    表达式求值-201308081712.txt
    Encoding-201308072147.txt
    A + B Problem II201308072001.txt
  • 原文地址:https://www.cnblogs.com/phantom-k/p/4297802.html
Copyright © 2011-2022 走看看