求助各位大牛!关于VB.NET淡入淡出效果
PublicClassForm1PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.Eve...
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Timer2.Enabled <> True Then
Timer2.Enabled = True
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.Opacity < 1 Then
Me.Opacity += 0.01
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If Me.Opacity > 0 Then
Me.Opacity -= 0.01
Else
Me.Close()
End If
End Sub
End Class
淡入可以实现,但淡出效果实现不了,按了“退出”按钮后窗体就一直闪个不停。问题出在哪里呢? 展开
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Timer2.Enabled <> True Then
Timer2.Enabled = True
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.Opacity < 1 Then
Me.Opacity += 0.01
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If Me.Opacity > 0 Then
Me.Opacity -= 0.01
Else
Me.Close()
End If
End Sub
End Class
淡入可以实现,但淡出效果实现不了,按了“退出”按钮后窗体就一直闪个不停。问题出在哪里呢? 展开
展开全部
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.Opacity < 1 Then
Me.Opacity += 0.01
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If Me.Opacity > 0 Then
Me.Opacity -= 0.01
Else
Me.Close()
End If
End Sub
If Me.Opacity < 1 Then
Me.Opacity += 0.01
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If Me.Opacity > 0 Then
Me.Opacity -= 0.01
Else
Me.Close()
End If
End Sub
微测检测5.10
2023-05-10 广告
2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇...
点击进入详情页
本回答由微测检测5.10提供
展开全部
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Timer1.Enabled = False
If Me.Opacity > 0 Then
Me.Opacity -= 0.01
Else
Me.Close()
End If
End Sub
Timer1.Enabled = False
If Me.Opacity > 0 Then
Me.Opacity -= 0.01
Else
Me.Close()
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你的代码里只有Timer2.Enabled = True
好像没有Timer2.Enabled = False
这样是不是timer控件始终是开着的?
好像没有Timer2.Enabled = False
这样是不是timer控件始终是开着的?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询