日历时间表 [英] Calender Schedule

查看:73
本文介绍了日历时间表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想在vb.net 2005中创建一个日历计划.我不知道要像使用任何列表视图一样使用哪个控件
,或使用datagridview显示调度详细信息.




问候,
saran

解决方案

对于简单的数据显示,列表视图可能更好.
如果您正在寻找数据绑定功能以及其他实现的复杂功能(例如行颜色,列颜色等),那么datagridview可能会更好.


此代码可能会帮助您:

 公共 部分  class  _Default:System.Web.UI.Page
{
    字符串 [,]假期=  字符串 [ 12  31 ];

    受保护的 无效 Page_Load(对象发​​件人,EventArgs e)
    {
        假期[ 0  0 ] = " 新年";
        假期[ 1  20 ] = " 我的生日";
        假期[ 6  24 ] = "  prannu生日";
        假期[ 9  30 ] = " 我的老公生日";
    }
              
    受保护的 无效 Calendar1_DayRender(对象发​​件人,DayRenderEventArgs e)
{
    字符串 s = " ;

         int  month = e.Day .Date .Month -1;
         int  d = e.Day.Date.Day- 1 ;
                s =假期[month,d];
        如果(s!= " )
            e.Cell .Controls .Add( LiteralControl("  + s +  </font>"));
}
} 


希望 CustomCalender [ ^ ]这将为您提供帮助.

Hi Guys,
I want to create a calender schedule in vb.net 2005.i did not get an idea to use which control like any list view
,or datagridview to show the scheduling details.




Regards,
saran

解决方案

For simple data display, listview may be better.

If you are looking for data binding features and other complex features implemented like row colors, column colors etc, then the datagridview might be better.


This code may help you:

public partial class _Default : System.Web.UI.Page 
{
    string[,] holidays = new string[12, 31];

    protected void Page_Load(object sender, EventArgs e)
    {
        holidays[0, 0] = "new year";
        holidays[1, 20] = "my birthday";
        holidays[6, 24] = "prannu birthday";
        holidays[9, 30] = "my hubby birthday";
    }
              
    protected void  Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    string s = " ";

        int month = e.Day .Date .Month -1;
        int d = e.Day.Date.Day - 1;
                s = holidays[month, d];
        if(s!=" ")
            e.Cell .Controls .Add (new LiteralControl ("<br> <font color=red> " +s +" </font> " ));
}
}


Hope CustomCalender[^] this will help you.


这篇关于日历时间表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆