Private Sub Command1_Click()Di
vb吧
全部回复
仅看楼主
level 5
Private Sub Command1_Click()
Dim year As Integer
Dim p As Integer
Dim s As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
year = InputBox("请输入年份", "年份输入", 2021)
p = InputBox("请输入一月一号是星期几", "星期输入", 5)
s = "日一二三四五六"
For k = 0 To 6
Print Tab(10 + k * 6); Mid(s, k + 1, 1);
Next k
Print
Print
For i = 1 To 12
Print Tab(25); Str(i); "月"
Print
Select Case i
Case 1, 3, 5, 7, 8, 10, 12
n = 31
Case 4, 6, 9, 11
n = 30
Case 2
n = 28
If year Mod 4 = 0 And year Mod 100 <> 0 Or year Mod 400 = 0 Then
n = 29
Else
n = 28
End If
End Select
For j = 1 To n
Print Tab(10 + p * 6); j;
p = p + 1
If p > 6 Then
p = 0
Print
End If
Next j
Print
Print
Print
Next i
End Sub
怎么让日历横向啊,问问大佬们
2021年04月21日 11点04分 1
level 5
我是一筹莫展啊,害
2021年04月21日 11点04分 2
level 5
有人舅舅孩子吗[泪][泪]
2021年04月21日 12点04分 3
level 11
你的意思是,一月的右边排二月,二月右边排三月……
但一行你准备几个月?
2021年04月21日 13点04分 4
一行两个月就好了
2021年04月21日 14点04分
level 15
简单一点的方法:
用12个图片框分别显示12个月,这样图片框的位置可以随心所欲地排列,想横向就横向,想纵向就纵向,甚至排列成3*4、2*6等格式都可以
麻烦一点的方法:
每输出完一个月之后,将CurrentY重新定位成0,并重新计算每个日期的Tab位置,甚至每个数在输出之前都用CurrentX和CurrentY进行定位(自己算去吧)
2021年04月21日 13点04分 5
谢谢谢谢
2021年04月21日 14点04分
level 11
方法三,一共六个单行字符串。
一月:第一周赋值第一个字符串,第二周……
二月:第一周拼凑到第一个字符串,第二周……
…………
…………
十二个月完了,依次输出六个字符串
2021年04月21日 13点04分 6
谢谢,我思考思考
2021年04月21日 14点04分
@贴吧用户_54WMEyZ 实际上楼上初音说的十二个图片框,是最好做的,也是最人性化的,建议你采用那个方案。
2021年04月22日 00点04分
@贴吧用户_54WMEyZ 我这里的这个方案,是当年在行式打印机上无奈的选择。
2021年04月22日 00点04分
叔,能不能打一行给我看看大概咋样,我比较傻,初学,不是很能懂[泪][泪]
2021年04月22日 08点04分
level 7
星期可以直接用weekday函数吧
2021年04月22日 01点04分 7
level 5
大佬牛逼
2021年04月23日 15点04分 8
level 5
Private Sub Command1_Click()
Dim year As Integer
Dim s As String
Dim i As Integer
Dim k As Integer
Dim j As Integer
Dim m As Integer
Dim n As Integer
Dim w As Integer
Dim x As Integer
Dim y As Integer
Dim z As Integer
Dim a As Integer
year = InputBox("aa", "bb", 2021)
w = InputBox("aa", "bb", 5)
a = w
s = "日一二三四五六"
For i = 1 To 6
Print Tab(25); Str(2 * i - 1); "月", Tab(90); Str(2 * i); "月"
For j = 0 To 13
If j + 1 <= 7 Then
Print Tab(25 + j * 6); Mid(s, j + 1, 1);
Else
Print Tab(50 + j * 6); Mid(s, j Mod 7 + 1, 1);
End If
Next j
Select Case i
Case 1
If year Mod 4 = 0 And year Mod 100 <> 0 Or year Mod 400 = 0 Then
n = 60
m = 31
Else
n = 59
m = 31
End If
Case 2, 3
n = 61
m = 31
Case 4
n = 62
m = 31
Case 5, 6
n = 61
m = 30
End Select
x = 0
y = 0
z = ((w + m Mod 7) Mod 7)
For k = 1 To 6
Do While w < 7
x = x + 1
If x > m Then
2021年05月31日 06点05分 9
level 5
过了好几周现在记起来发了
2021年05月31日 06点05分 10
1