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

[µo°Ý] ½Ð±Ð¦U¦ì¥ý¶i ¦h­ÓLabel³]©wªº°ÝÃD

[µo°Ý] ½Ð±Ð¦U¦ì¥ý¶i ¦h­ÓLabel³]©wªº°ÝÃD

¦p¹Ï,48­Ó¦â½X ­Ó§O¦Û©ñ¦b¤£¦PLabel¸Ì,·Æ¹«²¾¦ÜLabel¤W®É,TextBox1´N·|Åܦâ
¥Î OptionButton ±±¨î¤å¦r¤Î©³¦â ,Label1 ¦p¤U
Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If UserForm1.OptionButton1 = True Then
   UserForm1.TextBox1.BackColor = Sheets("sheet2").Range("a" & 1).Value
Else
   UserForm1.TextBox1.ForeColor = Sheets("sheet2").Range("a" & 1).Value
End If
End Sub
½Ð±Ð¦U¦ì¥ý«ô ¦p¦ó¤@¦¸³]©w48­ÓLabel©O, ÁÂÁ«ü±Ð

©³¹Ï¤å¦r.gif (23.18 KB)

©³¹Ï¤å¦r.gif

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-5-24 15:47 ½s¿è

¦^´_ 1# pinklee
¨Ï¥Î[ª«¥óÃþ§O¼Ò²Õ]  ¤@¦¸³]©w48­ÓLabel
ªí³æ¼Ò²Õµ{¦¡½X
  1. 'TextBox1´N·|Åܦ⠧令¬°  Label±±¨î¶µ ©R¦W¬°Label49
  2. Option Explicit
  3. Dim Form_Lable(1 To 48) As New Class1                 'Class1¬°[ª«¥óÃþ§O¼Ò²Õ]
  4. Private Sub CommandButton1_Click()
  5.     Unload Me
  6. End Sub
  7. Private Sub UserForm_Initialize()
  8.     Dim i
  9.     For i = 1 To 48                                    '48­Ó¦â½X ­Ó§O¦Û©ñ¦b¤£¦P Label1->  Label48
  10.         Set Form_Lable(i).La = Controls("Label" & i)   '«ü©w¨ìª«¥óÃþ§O¼Ò²Õªº LaÅܼƤ¤
  11.     Next
  12.     Label49.Caption = "¤å¦r¤Î©³¦â¹wÄý"
  13. End Sub
½Æ»s¥N½X
ª«¥óÃþ§O¼Ò²Õ Class1 µ{¦¡½X
  1. Option Explicit
  2. Public WithEvents La As MSForms.Label
  3. Private Sub La_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  4.      With UserForm1
  5.         If .OptionButton1 Then
  6.             .Label49.BackColor = La.BackColor
  7.         ElseIf .OptionButton2 Then
  8.             .Label49.ForeColor = La.BackColor
  9.         End If
  10.     End With
  11. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE


   
·PÁ GBKEE  ¤w¸g¥i¦æ

TOP

¥»©«³Ì«á¥Ñ borshun88 ©ó 2013-5-26 10:48 ½s¿è

¦^´_ 2# GBKEE

·PÁÂ GBKEE  ¤j¤j
¥i¥H¦b½Ð°Ý¤@­Ó°ÝÃD¡H
¦]¯S®í»Ý¨D¨Ï¥ÎLa_Click/La_Dblclick ¨Æ¥óµ{§Ç«á¤´¦³¥\¯à·Q­n¥[¤W¨t²Îµ{¦¡¤W,¦]¦¹·Q¼W¤@­Ó¨Ï¥Î·Æ¹«¥kÁä¨Ó°õ¦æµ{¦¡
¨Ò¦p " La_RightClick() " ¨Ï¥Î·Æ¹«¥kÁä¨Ó°õ¦æµ{¦¡
¦ý¦]¨t²Î¹w³]¨S¦³·Æ¹«¥kÁäclick¥\¯à,½Ð°Ý¬O§_¦³¿ìªk±N³o­Ó¥\¯à¥[¤W¥h?
·P®¦

TOP

¦^´_ 4# borshun88
  1. Private Sub Label1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  2.    'Shift :²Õ¦XÁä SHIFT,ALT,CTRL ªº¼Æ­È
  3.    'X ·Æ¹«X¶b¼Æ­È
  4.    'Y ·Æ¹«Y¶b¼Æ­È
  5.    Dim S As String
  6.    Select Case Button
  7.         Case 1
  8.             S = "[¥ªÁä]"
  9.         Case 2
  10.             S = "[¥kÁä]"
  11.     End Select
  12.     MsgBox "§A«ö¤F " & S
  13. End Sub

  14. Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  15.       Application.DisplayStatusBar = True
  16.       Application.StatusBar = "·Æ¹« X ¶b¼Æ­È : " & X & vbLf & "  ·Æ¹« Y ¶b¼Æ­È : " & Y
  17.       'Åã¥Ü¦bª¬ºA¦C
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE
·PÁÂ! °ÝÃD¸Ñ¨M¤F

TOP

        ÀR«ä¦Û¦b : ¯u¥¿ªº·R¤ß¡A¬O·ÓÅU¦n¦Û¤vªº³oÁû¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD