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

[µo°Ý] ¦p¦ó±Nªí³æ¤ºªºmultipage¼W³]ª«¥óÃþ§O©O¡H

[µo°Ý] ¦p¦ó±Nªí³æ¤ºªºmultipage¼W³]ª«¥óÃþ§O©O¡H

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

  ¤p§Ì¦bªí³æ¤ºªº¼W³]MULTIPAGE
¦³PAGE1¤ÎPAGE2¨Ã¦bUSERFORM_INITIALIZE
¼W³]¦¹ª«¥óÃþ§O®É¡A¥X²{¿ù»~¤º®e¦p¤U

°õ¦æ¶¥¬q¿ù»~-2147024809(80070057)
§ä¤£¨ì«ü©wª«¥ó¡A½Ð°ÝÀ³¦p¦ó­×¥¿
USERFORM1_INITIALIZE¤ºªº»yªk©O¡H

»yªk¦p¤U¡G

ª«¥óÃþ§O

Option Explicit

Public WithEvents mTxt As MSForms.TextBox
Public WithEvents mCmd As MSForms.CommandButton
Public WithEvents mPage As MSForms.MultiPage

Private Sub mCmd_Click()
   
    MsgBox mCmd.Name
   
End Sub

ªí³æ

Option Explicit
Dim mTb() As New myClass
Dim mCd() As New myClass
Dim mPg() As New myClass
Dim co1 As New Collection
Dim co2 As New Collection

Private Sub UserForm_Initialize()   
    Dim i As Long
    Dim j As Long
    Dim k As Long
   
    ReDim mTb(1 To 2)
    For i = 1 To 2
        Set mTb(i) = New myClass
        Set mTb(i).mTxt = Me.Controls("Textbox" & i)
        co1.Add mTb(i).mTxt
    Next
   
    ReDim mCd(1 To 6)
    For j = 1 To 6
        Set mCd(j) = New myClass
        Set mCd(j).mCmd = Me.Controls("CommandButton" & j)
        co2.Add mCd(j).mCmd
    Next
   
    ReDim mPg(0 To 1)
    For k = 0 To 1
        Set mPg(1) = New myClass   '»yªk¿ù»~
        Set mPg(1).mPage = Me.Controls("MultiPage" & k)
    Next            
End Sub

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

mPage2.rar (11.56 KB)

¦^´_ 14# dechiuan999
¤@¯ë¼Ò²Õ
  1. Option Explicit
  2. Dim A As New Class1
  3. Sub Ex()
  4.     ActiveSheet.[A1] = "THE TEST"
  5.     With A
  6.         Set .sPage = ActiveSheet
  7.         MsgBox .XX.[A1].Text
  8.     End With
  9. End Sub
½Æ»s¥N½X
ª«¥óÃþ§O¼Ò²Õ
  1. Option Explicit
  2. Public XX As Object
  3. Public Property Set sPage(setPage As Object)
  4.     Set XX = setPage
  5.     MsgBox XX.Name
  6. End Property
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 12# GBKEE


    ÁÂÁª©¥D¤j¤j¡C
¤p§Ì¹ïª«¥óÃþ§OÁ`¬O¤£±o
¨äªù¦Ó¤J¡A¹ï¦Û¤w´£°Ýªº°ÝÃD
¤]±`¦³¤£ª¾©Ò¤ª¡C½Ðª©¥D¤j¤j¨£½Ì¡C
¤p§Ì¤´¦³¤£¤F¸Ñ¤§³B¬O
¤w±Ntextbox¼W³]¤Fª«¥óÃþ§O
Public WithEvents mTxt As MSForms.TextBox
Public Property Set Tb(setTb As MSForms.TextBox)
    Set mTxt = setTb
End Property
¦¹¥Î³~¤S¬°¦ó©O¡H

TOP

·PÁ   «e½ú´£¨Ñ~¬Ý¹L¨ü¯q¨}¦h!!!

TOP

¦^´_ 10# dechiuan999
  1. Private Sub mPage_Change()
  2.     Select Case mPage.Value
  3.     Case 0
  4.          EmailForm1.TextBox2.SetFocus
  5.     Case 1
  6.         EmailForm1.TextBox4.SetFocus
  7.     End Select
  8. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ dechiuan999 ©ó 2013-10-29 08:43 ½s¿è

¦^´_ 6# stillfish00
ÁÂÁ¤G¦ì¤j¤jªº

TOP

¦^´_ 8# stillfish00
  1. ¼Ó¥DªºªþÀɪí³æ³»ºÝ¤wDim mPg() As New myClass
  2. ¥i¤£»Ý¦A­«½Æ Set mPg(1) = New myClass
½Æ»s¥N½X
  1. ¦pªGªþÀɪí³æ³»ºÝ¥u¬ODim mPg() As myClass
  2. ·íµM¬O»Ý¦A Set mPg(1) = New myClass
  3. ¨ºªþÀɪí³æ³»ºÝ¥u¶·¬ODim mPg()
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-10-27 12:37 ½s¿è

¦^´_ 7# GBKEE
«Å§i³oÃä¬O¦h¤F¡A¦ý§Úı±o¥ý
Dim mPg() As myClass
«á­±¦A
Set mPg(1) = New myClass
Å㦡¦a³Ð«Ø¹êÅé·|¤ñ¸û¦n¡A¤]¥i¥H©ú½Tª¾¹DClass_Initialize()³QIJµo¦ì¸m

TOP

¦^´_ 5# dechiuan999

  1. ªí³æ¤wDim mPg() As New myClass
  2. ¤£»Ý¦A Set mPg(1) = New myClass
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-10-25 20:04 ½s¿è

¦^´_ 5# dechiuan999
§Úª¾¹D§A­nªº¬O
myClass
  1. Option Explicit

  2. Public WithEvents mTxt As MSForms.TextBox
  3. Public WithEvents mCmd As MSForms.CommandButton
  4. Public WithEvents mPage As MSForms.MultiPage

  5. Private Sub mPage_Change()
  6.   MsgBox mPage.Pages(mPage.Value).Caption
  7. End Sub
½Æ»s¥N½X
Userform
  1. Private Sub UserForm_Initialize()
  2.    
  3.     Dim i As Long
  4.     Dim j As Long
  5.     Dim k As Long
  6.    
  7.     ReDim mTb(1 To 2)
  8.     For i = 1 To 2
  9.         Set mTb(i) = New myClass
  10.         Set mTb(i).mTxt = Me.Controls("Textbox" & i)
  11.         co1.Add mTb(i).mTxt
  12.     Next
  13.    
  14.     ReDim mCd(1 To 6)
  15.     For j = 1 To 6
  16.         Set mCd(j) = New myClass
  17.         Set mCd(j).mCmd = Me.Controls("CommandButton" & j)
  18.         co2.Add mCd(j).mCmd
  19.     Next
  20.    
  21.     ReDim mPg(1 To 1)
  22.     For k = 1 To 1
  23.         Set mPg(k) = New myClass
  24.         Set mPg(k).mPage = Me.Controls("MultiPage" & k)
  25.     Next
  26. End Sub
½Æ»s¥N½X
¦ý¬OÀ³¸Ó¬O Userform ¤W¦³«Ü¦h­Ó MultiPage ®É³o¼Ë¼g¤~¦³¥Î§a¡C

TOP

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD