vb.net – 如何确定winform上的不活动
发布时间:2020-12-17 00:03:03 所属栏目:大数据 来源:网络整理
导读:我有一个winform,显示在我的应用程序的顶部.我想要的是将表单设置为20%不透明度,如果它在一段时间内处于非活动状态.现在我点击按钮时会运行类似的事件,表单的大小会发生变化.我在执行转换时使用计时器设置窗体不透明度.我现在可以使用类似的代码来设置不透
我有一个winform,显示在我的应用程序的顶部.我想要的是将表单设置为20%不透明度,如果它在一段时间内处于非活动状态.现在我点击按钮时会运行类似的事件,表单的大小会发生变化.我在执行转换时使用计时器设置窗体不透明度.我现在可以使用类似的代码来设置不透明度,如果表单上有不活动,我只是不知道如何检测不活动.
这就是我所拥有的. Private Sub btnShowForm_Click(sender As Object,e As EventArgs) Handles btnShowForm.Click 'This procedure runs when the btnShowForm 'button is clicked. The procedure maximizes the size 'of the form,hides the left right button and displays the button 'to expand the form. It also moves the combobox down. 'It calls the viewButtons function to hide and 'display the right buttons. 'The procedure also uses a timer to set the fade in and out the 'form when is min or max Me.Height = 126 Me.Opacity = 0.2 'About 20% timNavigationPage.Interval = 100 'about one-tenth of a second timNavigationPage.Start() 'Start the timer cmbViewDataSheets.Location = New Point(741,89) viewButtons(False,True) End Sub Private Sub timNavigationPage_Tick(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles timNavigationPage.Tick 'Initialize the timer to fade form. Dim x As Double = 0.075 If Me.Opacity <= 1 Then Me.Opacity += x 'increment opacity with 7.5% ElseIf Me.Opacity + x > 1 Then timNavigationPage.Stop() 'Stop the timer then the opacity has reached a 100% End If End Sub
这是一个很棒的
example,使用user32.dll的GetLastInputInfo
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- delphi – 如何使一个CustomComponents检测表单上是否有新组
- 如何更新Delphi Object Inspector?
- 当从Perl模块调用方法时,为什么’::’和’ – >’可互换地工
- delphi – 什么意思是VarType(aVariant)= 273(或$111)?
- vb.net里 对文件夹进行添加,复制,移动,删除 源码实例
- ThinkPHP使用Smarty第三方插件方法小结
- 多界面有背景程序在界面(窗体或窗体内容)切换时,闪烁问题
- 在Lua中使用List 和 栈图
- vb中利用winsock控件,tcp协议实现多服务端连接
- 使用perl socket 在WINDOWS DHCP服务上 实现ip绑定