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;
                }
            }
  • 相关阅读:
    HDU 4053 or ZOJ 3541 The Last Puzzle【区间dp】【经典题】
    HDU 4053 or ZOJ 3541 The Last Puzzle【区间dp】【经典题】
    Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) 831C. Jury Marks【二分】【水题】
    Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) 831C. Jury Marks【二分】【水题】
    POJ 2955 Brackets 【区间dp】【水题】
    POJ 2955 Brackets 【区间dp】【水题】
    动手动脑2
    统计创建了多少类
    动手动脑1
    动手动脑
  • 原文地址:https://www.cnblogs.com/phantom-k/p/4297802.html
Copyright © 2011-2022 走看看