'全部顯示
Private Sub Command1_Click()
MSChart1.Left = Picture1.ScaleLeft
MSChart1.Top = Picture1.ScaleTop
MSChart1.Height = Picture1.ScaleHeight
MSChart1.Width = Picture1.ScaleWidth
HScroll1.Enabled = False
End Sub
'2倍顯示
Private Sub Command2_Click()
MSChart1.Left = Picture1.ScaleLeft
MSChart1.Top = Picture1.ScaleTop
MSChart1.Height = Picture1.ScaleHeight
MSChart1.Width = Picture1.ScaleWidth * 2
HScroll1.Max = 100
HScroll1.Min = 0
HScroll1.Value = 0
HScroll1.SmallChange = 10
HScroll1.LargeChange = 20
HScroll1.Enabled = True
End Sub
'4倍顯示
Private Sub Command3_Click()
MSChart1.Left = Picture1.ScaleLeft
MSChart1.Top = Picture1.ScaleTop
MSChart1.Height = Picture1.ScaleHeight
MSChart1.Width = Picture1.ScaleWidth * 4
HScroll1.Max = 100
HScroll1.Min = 0
HScroll1.Value = 0
HScroll1.SmallChange = 10
HScroll1.LargeChange = 20
HScroll1.Enabled = True
End Sub
'初始化
Private Sub Form_Load()
MSChart1.Left = Picture1.ScaleLeft
MSChart1.Top = Picture1.ScaleTop
MSChart1.Height = Picture1.ScaleHeight
MSChart1.Width = Picture1.ScaleWidth * 2
HScroll1.Max = 100
HScroll1.Min = 0
HScroll1.Value = 0
HScroll1.SmallChange = 10
HScroll1.LargeChange = 20
End Sub
'滾動條
Private Sub HScroll1_Change()
MSChart1.Left = Picture1.ScaleLeft - (MSChart1.Width - Picture1.ScaleWidth) * HScroll1.Value * 0.01
Form1.Refresh
End Sub