ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

«ç»ò¤~¯à¦b¸U¦~¾ä¤W¼W¥[®É¶¡

¦^´_ 1# Jared


  
  1. Private Sub ¸U¦~¾ä()
  2.     Dim OBtop As Integer, OBLeft As Integer, R As Integer, W As Integer, i As Date
  3.         R = Label1.Top + 30
  4.           ReDim F_OB(1 To Day(DateSerial(ComboBox1, ComboBox2.Value + 1, 0)))
  5.           For i = DateSerial(ComboBox1, ComboBox2, 1) To DateSerial(ComboBox1, ComboBox2.Value + 1, 0) '¦~¤ë1¤é¨ì31¤é
  6.         W = Weekday(i) '¦ì¸m
  7.         'With¥]Âе{¦¡¬°¤Ñ¼Æ¹Bºâ
  8.         With Controls.Add("Forms.OptionButton.1", i) 'Controls¬°±±¨î¶µ¡FOptionButton¬°³æ¿ï¯Ã
  9.             .Visible = True
  10.             .ControlTipText = i
  11.             .Top = R '³Ì¤W­±¨º±Æ
  12.             .Left = Controls("Label" & W).Left '²Ä¤@¦æ§e²{¦ì¸m
  13.             .Height = 15      '°ª«×
  14.             .Width = 30       '¼e«×
  15.             .Caption = Day(i) '­pºâ·í¤ë³Ì«á¤@¤Ñ¤Ñ¼Æ
  16.         End With
  17.         Set F_OB(Day(i)).OB = Controls(i & "") '& c  '³æ¿ï¯Ã·|¼u¸õ¥X°T®§
  18.         If Weekday(i) = 7 And Month(i) = Month(i + 1) Then
  19.             R = R + 30 '·í¦ì¸mµ¥©ó7,R´N¥[30   '** ³Æµù ­n¦Ò¼{¨ì¦P¤ë¥÷¦Ü¤ÖÁÙ¦³¤@¤Ñ **
  20.         End If
  21.      Next
  22.        Me.Frame1.Top = R + 30             '½Õ¾ã ®É¶¡ªº¦ì¸m
  23.        Me.Height = R + Frame1.Height + 60 '½Õ¾ã ªí³æªº°ª«×
  24. End Sub
½Æ»s¥N½X
  1. Option Explicit
  2. Public WithEvents OB As MSForms.OptionButton
  3. Private Sub OB_Click()
  4.     Dim h As String, m As String
  5.     With UserForm1
  6.         h = "00 ®É "
  7.         m = "00 ¤À "
  8.         With .TextBox1
  9.             If Val(.Text) >= 0 And Val(.Text) <= 24 Then h = Format(Val(.Text), "00 ®É ")
  10.         End With
  11.         With .TextBox2
  12.             If Val(.Text) >= 0 And Val(.Text) <= 60 Then m = Format(Val(.Text), "00 ¤À")
  13.         End With
  14.         test.TextBox1.Value = OB.ControlTipText & " " & h & m
  15.         .Hide
  16.     End With
  17. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 3# Jared
¥t¥i¨Ï OptionButton ¤£¥i¥Î
  1. Option Explicit
  2. Public WithEvents OB As MSForms.OptionButton
  3. Public WithEvents Tx As MSForms.TextBox
  4. 'UserForm_Initialize ¤¤³]¥ß TextBox1,TextBox2
  5. Private Sub Tx_Change()
  6.     Dim Msg As Boolean, E As Control
  7.     With Tx
  8.         If IsNumeric(.Text) Then
  9.             If Tx.Name = "TextBox1" Then
  10.                 If Val(.Text) > 0 And Val(.Text) <= 24 Then Msg = True
  11.             ElseIf Tx.Name = "TextBox2" Then
  12.                 If Val(.Text) > 0 And Val(.Text) <= 60 Then Msg = True
  13.             End If
  14.         End If
  15.     End With
  16.     For Each E In Tx.Parent.Controls
  17.         If TypeName(E) = "OptionButton" Then E.Enabled = Msg
  18.     Next
  19. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD