冰楓論壇

標題: 冒出廣告實作 [打印本頁]

作者: xpoi5020    時間: 2016-5-3 19:32
標題: 冒出廣告實作
範例圖:
Desktop 05.03.2016 - 19.21.40.02000.gif

程式碼:
  1. Public Class Form1
  2.     Dim MoveInt As Int64
  3.     Dim Move2 As Int64
  4.     Dim Move3 As Int64
  5.     Dim Down As Int64 = My.Computer.Screen.WorkingArea.Height + Me.Size.Height
  6.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  7.         Me.Location = New Point(My.Computer.Screen.Bounds.Width - Me.Size.Width, My.Computer.Screen.Bounds.Height + Me.Size.Height)
  8.         MoveInt = My.Computer.Screen.Bounds.Height - My.Computer.Screen.WorkingArea.Height
  9.         Move2 = MoveInt + Me.Size.Height
  10.         Move3 = My.Computer.Screen.Bounds.Height - Move2
  11.         MOve.Start()
  12.     End Sub
  13.     Private Sub MOve_Tick(sender As Object, e As EventArgs) Handles MOve.Tick
  14.         If Move3 < Me.Location.Y Then
  15.             Me.Location = New Point(Me.Location.X, Me.Location.Y - 5)
  16.         Else
  17.             Me.TopMost = True

  18.             MOve.Stop()

  19.         End If
  20.     End Sub

  21.     Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
  22.         Me.TopMost = False
  23.         MOVEDOWN.Start()
  24.     End Sub

  25.     Private Sub MOVEDOWN_Tick(sender As Object, e As EventArgs) Handles MOVEDOWN.Tick
  26.         If Down > Me.Location.Y Then
  27.             Me.Location = New Point(Me.Location.X, Me.Location.Y + 5)
  28.         Else

  29.             End
  30.             MOVEDOWN.Stop()
  31.         End If
  32.     End Sub

  33.     Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click

  34.     End Sub
  35. End Class
複製代碼
MOve跟MOVEDOWN 是Timer
Interval 都是1







歡迎光臨 冰楓論壇 (https://bingfong.com/) Powered by 冰楓