我創建了這個子來做一些格式化,具體取決于ActiveControl CommandButton
Sub ReFormat(Sender As CommandButton)
'Me.PictureBox.Picture = Me.Controls(Sender).Picture
Me.PictureBox.Picture = Sender.Picture
Me.lbl.Caption = Sender.Caption
Sender.PictureCaptionArrangement = acRight
Sender.FontBold = True
Sender.ForeColor = RGB(45, 48, 60)
End Sub
并從以下位置呼叫它:
Private Sub Command0_Click()
ReFormat (ActiveControl)
End Sub
它拋出這個錯誤

我試過這個
Sub ReFormat(Sender As Object)
Sub ReFormat(Sender As Control)
還是一樣 。
我究竟做錯了什么 ?
uj5u.com熱心網友回復:
括號使其只讀。嘗試:
ReFormat ActiveControl
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/468357.html
