- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 3# reangame - Dim XToggle() As New Class1
- Private Sub ComboBox1_Change()
- If ComboBox1 <> "" And ComboBox2 <> "" Then ¦æ¨Æ¾ä»s§@
- End Sub
- Private Sub ComboBox2_Change()
- If ComboBox1 <> "" And ComboBox2 <> "" Then ¦æ¨Æ¾ä»s§@
- End Sub
- Sub ¦æ¨Æ¾ä»s§@()
- Dim sp As Control
- For Each sp In UserForm1.Frame2.Controls
- If sp.Name Like "ToggleButton*" Then Me.Controls.Remove sp.Name
- Next
- day1 = DateSerial(Val(ComboBox1), Val(ComboBox2), 1)
- day2 = DateSerial(Val(ComboBox1), Val(ComboBox2) + 1, 0)
- w = Weekday(day1, vbMonday)
- ReDim XToggle(day1 To day2)
- For I = day1 To day2
- k = Int((Day(I) + w - 2) / 7)
- s = Weekday(I, vbMonday)
- kk = Int((Day(I) + w - 2) / 7)
- If kk = 5 Then
- Frame1.Height = 262
- Else
- Frame1.Height = 222
- End If
-
- With Frame2.Controls.Add("forms.ToggleButton.1")
- .Top = (k * 38) - 1
- .Left = (42 * (s - 1)) - 2
- .Height = 38
- .Width = 42
- .Caption = Day(I)
- Set XToggle(I).Toggle = Controls(.Name)
- 'ª«¥óÅܼƫü©w¬° Controls(.Name)
- End With
- Next
- End Sub
½Æ»s¥N½X
- Option Explicit
- Public WithEvents Toggle As MSForms.ToggleButton
- Private Sub Toggle_Click()
- With Toggle
- .BackStyle = 1
- If .Value Then
- .Font.Size = 18
- .Font.Bold = True
- .BackColor = vbYellow
- Else
- .Font.Size = 12
- .Font.Bold = False
- .BackColor = &H8000000F
- End If
- End With
- End Sub
½Æ»s¥N½X |
|