最豪华飞机头等舱图片:mschart控件加滚动条

来源:百度文库 编辑:偶看新闻 时间:2024/04/28 11:25:09


'全部显示
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