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

[µo°Ý] ¦p¦ó­×¥¿ª«¥óÃþ§O»yªk©O¡H

[µo°Ý] ¦p¦ó­×¥¿ª«¥óÃþ§O»yªk©O¡H

¦U¦ì¤j¤j¦n¡G

   ¤p§Ì±qºô·~·j¶°¨ìQEE¤j¤jª«¥óÃþ§O½d¨Ò¡A
°õ¦æ«o¥X²{¡©µLªk³B²z©Ò«ü©wª«¥óªº¨Æ¥ó¡¨
½Ð°ÝÀ³¦p¦ó­×¥¿¤U¦C»yªk©O¡H
test.rar (7.29 KB)
»yªk¦p¤U¡G
Option Explicit
Dim WithEvents mc As myClass    'µLªk³B²z©Ò«ü©wª«¥óªº¨Æ¥ó
Public Event Change(ByRef Cancel As Boolean)
Private s$
Public Property Get Value() As String
  Value = s
End Property
Public Property Let Value(ByVal c As String)
  s = c
End Property
Private Sub Class_Initialize()
  s = "abc"  'ªì©l­È
End Sub

Private Sub CommandButton1_Click()
  mc.Value = TextBox1 '½á­È
End Sub
Private Sub CommandButton2_Click()
  MsgBox "mc·í«eªº­È¬°" & mc.Value 'Ū­È
End Sub
Private Sub mc_Change(ByRef Cancel As Boolean)
  If MsgBox("­n§ïÅÜmcªº­È¶Ü?", vbYesNo) = vbNo Then Cancel = True
End Sub
Dim mc As New myClass
Private Sub UserForm_Initialize()  
  Set mc = New myClass  
End Sub



ÁÂÁ¦U¦ì¤j¤j¡I

¦^´_ 1# dechiuan999
½Ð°Ý §A¬O­n±NUserForm1 ¤¤ªº¨º¤@­Ó±±¨î¶µ ³]©w¨ìª«¥óÃþ§O¼Ò²Õ myClass ¤¤

TOP

¦^´_ 2# GBKEE
ª©¥D¤j¤j±z¦n¡G

   ¤p§Ì¹ïª«¥óÃþ§O¤@ª½³B¦bÃú¸Ì¬Ýªáªº¬Ò¬q¡A
¥Ø«e³£¬O¥Ñºô­¶·j´M¤@¨Ç½d¨Ò¨Ó¾Ç²ß¡C
¦]¦¹¡A¹ï¦¹»yªk¯u¥¿ªí¹Fªº¤º§t¹ê¦bµLªk§¹¥þ²z¸Ñ¸Ñ¡C

¤p§Ì¦A¦¸¨ìQEE¤j¤jªººô¯¸±N¨ä¤å·N½Æ»s¨Ñª©¥D¤j¤j¹L¥Ø¡A
§Æ±æ¯àÅýª©¥D¦³©Ò§U¯q¡C
¸ü­n¦p¤U¡G
http://club.excelhome.net/thread-198049-2-1.html
¤»¡B³Ð«ØÃþ¨Æ¥ó

³o¬q¥N½X¹ê²{ªº¬O¡A·íÂIÀ»CommandButton1®É
«K·|±NTextBox1ªº­È½áµ¹mcªºValue¡A
·íÂIÀ»CommandButton2®É«K·|Åã¥Ümc·í«eªºValue­È¡C

¦¹½d¨Ò¨ä¹ê©|¦³
²Ä¤G¨B¡G¨Ï¥ÎRaiseEvent»y¥y¤Þµo¨Æ¥ó

¤p§Ì·Q»¡¥ý´ú¸Õ«e¬q»yªkµ¥²z¸Ñ¤§«á¡A
¦A¸ü¤J²Ä¤G¨BªºRaiseEvent»y¥y¤Þµo¨Æ¥ó
¨Ó¾Ç²ß¡C

¤£ª¾¬O§_¦]¬°¥¼§¹¥þ±N»yªk¥þ³¡²Õ¦X¦Ó¼vÅT¨ì
µ{¦¡ªº°õ¦æ¶Ü¡H


·P®¦¤j¤j¡I

TOP

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