| ©«¤l5923 ¥DÃD13 ºëµØ1 ¿n¤À5986 ÂI¦W0  §@·~¨t²Îwin10 ³nÅ骩¥»Office 2010 ¾\ŪÅv150 ©Ê§O¨k ¨Ó¦Û¥xÆW°ò¶© µù¥U®É¶¡2010-5-1 ³Ì«áµn¿ý2022-1-23 
         
 | 
                
| ¦^´_ 10# dafa ¶·¬O§A»¡ªº:§â©Ò¦³CommandButton¹ïÀ³Àx¦s®æ¦A¦s¤J¹ïÀ³ªºÀɦW¤~¯à¸Ñ¨M ÀɦW¦s©óSheets("¤u§@ªí1")¸Ì¤~¯à¦p§A©ÒÄ@
 ½Ð×§ïGW4501ªí³æUserForm_Initializeµ{¦¡½X ¦p¤U
 ½Ð×§ïTheButton¼Ò²Õ¤º½Æ»s¥N½XOption Explicit
'Public dw  'GW45011ªí³æ¤£¶·«Å§i: [Module1]¼Ò²Õ¤w«Å§i¹L
Public Sh As Worksheet   '¶··s¥[¤½¥ÎÅÜ¼Æ [TheButton] ¼Ò²Õ¤~¥i¤Þ¥Î
Dim ButtonClass() As New TheButton
Private Sub UserForm_Initialize()
Dim E As Control, i As Integer
Dim hWnd, tPath, oo
GW4501.Height = Sheets("¤u§@ªí3").Cells(3, 7) / 5
GW4501.Width = Sheets("¤u§@ªí3").Cells(3, 2) / 5
hWnd = GetForegroundWindow
tPath = ActiveWorkbook.Path & "\©³¹Ï\"
'tPath = Application.GetOpenFilename("EXCEÀÉ(*.XLS),*xls")'
[c1] = tPath
oo = Dir(tPath)
If oo = "" Then
    MsgBox "§A©³¹Ï¸ê®Æ§¨¤º¨S©ñ¶i¹ÏÀÉ"
    End
Else
    [c2] = tPath & oo
    GW4501.Picture = LoadPicture(tPath & oo)
End If
'ButtonClassÅܼƳ]©w¬° New TheButtonª«¥óÃþ§O¼Ò²Õ
Set Sh = Sheets("¤u§@ªí1")   '¤u§@ªíÀx¦s¹Ïªí¸ô®|
With Sh
    For Each E In Me.Controls
        If InStr(E.Name, "CommandButton") Then
            i = i + 1
            ReDim Preserve ButtonClass(1 To i)
            Set ButtonClass(i).Button = E     '«ü©w TheButton.Button(i) ªºª«¥ó
            '*** CommandButton¹ïÀ³Àx¦s®æ¦A¦s¤J¹ïÀ³ªºÀɦW ***
            E.ControlTipText = Cells(i, "A").Address(0, 0) & ":"
            If Dir(.Cells(i, "A").Text) <> "" Then
                E.Picture = LoadPicture(.Cells(i, "A").Text)
                E.ControlTipText = E.ControlTipText & .Cells(i, "A")
                'CommandButtonªºControlTipText= .Cells(i, "A")ªº¦C¦W¤Î¤º®e(ÀɦW)
            End If
        End If
    Next
End With
End Sub
½Æ»s¥N½XOption Explicit
Public WithEvents Button As MSForms.CommandButton
Private Sub Button_Click()
    Dim S
    S = Split(Button.ControlTipText, ":")
    If S(1) = "" Then
        Call ´Óª«
        Button.Picture = LoadPicture(dw)
        Button.ControlTipText = Button.ControlTipText & dw
        S = Split(Button.ControlTipText, ":")
        GW4501.Sh.Range(S(0)) = dw
         'CommandButton¹ïÀ³ªºÀx¦s®æ¦s¤J: ÀɦW
        dw = ""
    End If
End Sub
 | 
 |