动态创建的frae和滚动条,想滑动滚动条时frame向上或向下跟着移动。为何滚动条无反应?请问版主我的代码错在什么地方?
Private Sub Form_Load()
Set Frame0 = Controls.Add("VB.frame", "Frame0") '创建能整体移动的frame
' Set Frame0.Container = Form1
Frame0.Move 400, 1000, 4000, 5000
Frame0.BackColor = &HFFFFF
Frame0.Visible = True
Set VScroll1 = Controls.Add("VB.VScrollbar", "VScroll1") '创建能控件frame移动的滚动条
' Set VScroll1.Container = Form
VScroll1.Move Frame0.Width + 400, 1000, 400, Frame0.Height
VScroll1.TabStop = False
VScroll1.Visible = True
VScroll1.Min = 0
VScroll1.Max = Frame0.Height
VScroll1.SmallChange = 100
VScroll1.LargeChange = Frame0.Height
End Sub
Private Sub VScroll1_Change()
Frame0.Move 400, -VScroll1.Value
End Sub
Private Sub VScroll1_Scroll() '请问对于动态创建的可不可以这样写Private Sub VScroll1_Scroll()
Frame0.Move 400, -VScroll1.Value
End Sub