标题:关于显示日期的问题
只看楼主
lingkongyu
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2007-7-17
 问题点数:0 回复次数:2 
关于显示日期的问题

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim i As Integer
If Not IsPostBack Then
For i = 1901 To 2050
ddlyear.Items.Add(CStr(i))
Next
For i = 1 To 2
ddlmonth.Items.Add(CStr(i))
Next
ddlyear.SelectedValue = Now.Year
ddlmonth.SelectedValue = Now.Month
For i = 1 To Day(Now.Year, Now.Month)
ddlday.Items.Add(CStr(i))
Next
ddlday.SelectedValue = Now.Day
End If

End Sub

Protected Sub ddlyear_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlyear.SelectedIndexChanged
Dim i, y, m As Integer
y = ddlyear.SelectedValue
m = ddlmonth.SelectedValue
ddlday.Items.Clear()
For i = 1 To Day(y, m)
ddlday.Items.Add(CStr(i))
Next
End Sub

_-----------------------------------------------
蓝色括号里出现错误,如何改正?错误提示是:public funtion day(datevalue as date ) as integer 的参数太多

搜索更多相关主题的帖子: 1901 2050 Object color 
2007-07-17 11:07
taick
Rank: 1
等 级:新手上路
威 望:1
帖 子:71
专家分:0
注 册:2007-7-16
得分:0 
晕~
参数多了
Day(Now.Year, Now.Month)这不是有两个参数吗?
应该是
Day(Now)才对
2007-07-17 11:55
lingkongyu
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2007-7-17
得分:0 

谢谢。对vb懂的少


2007-07-17 14:46



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-155970-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.109201 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved