zoukankan      html  css  js  c++  java
  • 给Calendar添加标签

     

    给日历上特殊的日子,加一个标签。

    一是要判断日期,是不是特殊的日期。二是在Calendar呈现(Render)之前进行一些处理。

    1.      在页面上放一个Calendar

    2.      编写CalendarDayRender事件

        Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender

            If e.Day.Date.Month = 7 And e.Day.Date.Day = 7 Then

                Dim l As New Label

                With l

                    .Text = "抗日纪念日"

                    .BackColor = Drawing.Color.Red

                    .BorderStyle = BorderStyle.Solid

                    .BorderWidth = 1

                End With

                e.Cell.Controls.Add(l)

            End If

        End Sub

    Ok了,效果如下:

    循序渐进,先从简单学起。

  • 相关阅读:
    团购倒计时
    折半查找
    比较函数
    行为驱动开发: Cucumber的目录结构和执行过程 (转载)
    ruby 方法查找 and执行方法
    Rubyinstance_variable_get(@xx)
    Ruby 模块
    散列
    ruby webdriver 启动firefox driver时,加载firebug的扩展
    git使用简介
  • 原文地址:https://www.cnblogs.com/htht66/p/1236684.html
Copyright © 2011-2022 走看看