以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  吐糟下popmessage  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=87404)

--  作者:rjh4078
--  发布时间:2016/7/11 9:12:00
--  吐糟下popmessage

  老大多弄点样式啊  我的屏幕每次弹出的时候 下面突然白一片 然后冒出个窗口 这个动画效果好生硬


--  作者:大红袍
--  发布时间:2016/7/11 9:52:00
--  

窗口可以自己做。下面是popmessage的实现代码

 

全局代码

 

<DllImport("user32.dll", EntryPoint := "AnimateWindow")> _
Public Function AnimateWindow(handle As IntPtr, ms As Integer, flags As Integer) As Boolean
End Function
Public Const AW_HOR_POSITIVE As Int32 = &H1
Public Const AW_HOR_NEGATIVE As Int32 = &H2
Public Const AW_VER_POSITIVE As Int32 = &H4
Public Const AW_VER_NEGATIVE As Int32 = &H8
Public Const AW_CENTER As Int32 = &H10
Public Const AW_HIDE As Int32 = &H10000
Public Const AW_ACTIVE As Int32 = &H20000
Public Const AW_SLIDE As Int32 = &H40000
Public Const AW_BLEND As Int32 = &H80000

Public Class MyForm
Inherits System.Windows.Forms.Form

Public Sub new()
End Sub

Public Sub new(info As String)
Dim lbl As new Windows.Forms.Label
lbl.Text = info
lbl.Top = 100
lbl.left =  100
me.Controls.Add(lbl)
addhandler me.Load, AddressOf MyForm_Load
addhandler me.FormClosing, AddressOf MyForm_FormClosing
me.width = 200
me.height = 200
End Sub

Private Sub MyForm_Load(sender As Object, e As EventArgs)
 Dim x As Integer = Windows.Forms.Screen.PrimaryScreen.WorkingArea.Right - Me.Width
 Dim y As Integer = Windows.Forms.Screen.PrimaryScreen.WorkingArea.Bottom - Me.Height
 Me.Location = New Point(x, y)
 \'设置窗体在屏幕右下角显示
 AnimateWindow(Me.Handle, 1000, AW_SLIDE Or AW_ACTIVE Or AW_VER_NEGATIVE)
End Sub

Private Sub MyForm_FormClosing(sender As Object, e As Windows.forms.FormClosingEventArgs)
 AnimateWindow(Me.Handle, 1000, AW_BLEND Or AW_HIDE)
End Sub

End Class

 

调用代码

 

Dim frm As new myform("ABCDEFG")
frm.show

 

关于样式,参考 http://www.cnblogs.com/KeenLeung/archive/2013/05/19/3087728.html

 


--  作者:rjh4078
--  发布时间:2016/7/13 13:27:00
--  

还是没搞懂样式怎么弄


--  作者:大红袍
--  发布时间:2016/7/13 16:00:00
--  

编写全局代码。

 

然后做一个按钮编写调用代码。