我创建这个子程序是为了根据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)还是一样的。
我做错什么了?
发布于 2022-04-25 11:52:31
括号使它成为只读的。尝试:
ReFormat ActiveControlhttps://stackoverflow.com/questions/71998903
复制相似问题