加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

VB工程---百例75--状态栏

发布时间:2020-12-16 22:38:55 所属栏目:大数据 来源:网络整理
导读:重点statusbar外部控件的掌握 Option Explicit Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single) stb1.Panels(3) = "X:" Str(X) '第3个窗体上显示鼠标在图像框的水平位置 stb1.Panels(4) = "Y:" Str(Y) '第4个窗体

重点statusbar外部控件的掌握

Option Explicit
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
stb1.Panels(3) = "X:" & Str(X) '第3个窗体上显示鼠标在图像框的水平位置
stb1.Panels(4) = "Y:" & Str(Y) '第4个窗体上显示鼠标在图像框的垂直位置
stb1.Panels(5) = Form1.Tag '第5个窗体上显示窗体的标识
End Sub


Private Sub Image1_MouseMove(Button As Integer,Y As Single)
stb1.Panels(3) = "X:" & Str(X)
stb1.Panels(4) = "Y:" & Str(Y)
stb1.Panels(5).Text = Image1.Tag '第5个窗体上显示image1的标识
End Sub

Private Sub Image2_MouseMove(Button As Integer,Y As Single)
stb1.Panels(3) = "X:" & Str(X)
stb1.Panels(4) = "Y:" & Str(Y)
stb1.Panels(5).Text = Image2.Tag '第5个窗体上显示显示image2的标识
End Sub

Private Sub Image3_MouseMove(Button As Integer,Y As Single)
stb1.Panels(3) = "X:" & Str(X)
stb1.Panels(4) = "Y:" & Str(Y)
stb1.Panels(5).Text = Image3.Tag '第5个窗体上显示显示image3的标识
End Sub
Private Sub Image4_MouseMove(Button As Integer,Y As Single)
stb1.Panels(3) = "X:" & Str(X)
stb1.Panels(4) = "Y:" & Str(Y)
stb1.Panels(5).Text = Image4.Tag '第5个窗体上显示显示image4的标识
End Sub

Private Sub Timer1_Timer()
stb1.Panels(1) = Date '在状态栏的第1个窗体显示当前日期
stb1.Panels(2) = Time '在状态栏的第2个窗体显示当前时间
End Sub

这个实例从程序上乍一看,第一次接触activex外部控件,真的有些丈二的和尚,摸不着头脑。其实好好想想,看看没有那么难,因为好多小知识,都是重复的。仔细研究了一下书本实例,又读了些前面的知识点。慢慢的我写出来了。其实本不难,只是我把它想难了而已。克服这种心理压力!慢慢来,慢慢来!总结,总结!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读