如何变更VBA窗体的图片
1个回答
展开全部
写一段宏就可以了。
sub change()
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
Dim fA()
Dim i%, n%
Dim dName$
ChDrive "c"
ChDir "C:\Photographs\Zelda"
dName = Dir("*.jpg")
Do While dName <> ""
n = n + 1
ReDim Preserve fA(1 To n)
fA(n) = dName
dName = Dir()
Loop
For i = 1 To n
ComboBox1.AddItem fA(i)
Next
ComboBox1.ListIndex = 0
Application.ScreenUpdating = True
End Sub
end sub
sub change()
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
Dim fA()
Dim i%, n%
Dim dName$
ChDrive "c"
ChDir "C:\Photographs\Zelda"
dName = Dir("*.jpg")
Do While dName <> ""
n = n + 1
ReDim Preserve fA(1 To n)
fA(n) = dName
dName = Dir()
Loop
For i = 1 To n
ComboBox1.AddItem fA(i)
Next
ComboBox1.ListIndex = 0
Application.ScreenUpdating = True
End Sub
end sub
更多追问追答
追问
那么如果我要调整窗体里面的一个文本框输入的字数数量呢?
追答
说来话长
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询