如何在Web应用程序中更改Calander的颜色?

编程入门 行业动态 更新时间:2024-10-22 21:32:59
本文介绍了如何在Web应用程序中更改Calander的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在Web应用程序中更改Calander的颜色? 请帮助我,先生.....

How to change the Colour of a Calander in Web Application? please help me sir.....

推荐答案

类似 something like Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender Dim onmouseoverStyle As String = "this.style.backgroundColor='#D4EDFF'" Dim onmouseoutStyle As String = "this.style.backgroundColor='@BackColor'" Dim rowBackColor As String = String.Empty e.Cell.Attributes.Add("onmouseover", onmouseoverStyle) e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor)) End Sub

有关日历控件的更多提示,请参见以下链接: weblogs.sqlteam. com/jhermiz/archive/2007/12/10/Cool-Tricks-With-The-ASP-Calendar.aspx [ ^ ]

see the following link for more tips on calendar control: weblogs.sqlteam/jhermiz/archive/2007/12/10/Cool-Tricks-With-The-ASP-Calendar.aspx[^]

只需签出这段代码,非常有帮助! 关于我的背景颜色发生变化并且不会再出现"的评论,这是我所做的事情: Just checked out this code, very helpful ! Concerning the "My background color changes and doesn''t come back" comment, here is what I did : Protected Sub Main_Calendar_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Main_Calendar.DayRender Dim onmouseoverStyle As String = "this.style.backgroundColor='#D4EDFF'" Dim DayColor As String = "this.style.backgroundColor='#99CCCC'" Dim BackColor As String = "this.style.backgroundColor='White'" If e.Cell.BackColor = Drawing.Color.FromArgb(153, 204, 204) Then If Not e.Day.IsWeekend Then e.Cell.Attributes.Add("onmouseover", onmouseoverStyle) e.Cell.Attributes.Add("onmouseout", DayColor) End If Else If Not e.Day.IsWeekend Then e.Cell.Attributes.Add("onmouseover", onmouseoverStyle) e.Cell.Attributes.Add("onmouseout", BackColor) End If End If End Sub

我在日历上创建了与不同颜色一样多的变量. 然后,使用"if"语句检查当天的颜色.如果它是蓝色,则在"mouseout"上将再次变为蓝色,否则将变为白色. 希望对您有所帮助.

I created as many variables as different colors on the calendar. Then, with an "if" statement, I check the color of the day. If it''s blue, it will become blue again on "mouseout", or white otherwise. Hope this helped.

更多推荐

如何在Web应用程序中更改Calander的颜色?

本文发布于:2023-11-12 11:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581440.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   颜色   如何在   Web   Calander

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!