VB 让程序运行不显示窗体
就像一些小程序,在桌面上跑来跑去。是Form1.FontTransparent=False吗?好像不行的样子。我要学做一个整人的小程序试试。...
就像一些小程序,在桌面上跑来跑去。是 Form1.FontTransparent = False 吗 ?好像不行的样子。我要学做一个整人的小程序试试。
展开
展开全部
程序代码
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_EX_LAYERED = &H80000
Const GWL_EXSTYLE = (-20)
Const LWA_ALPHA = &H2
Const LWA_COLORKEY = &H1
在窗体中这样调用:
程序代码
Private Sub Form_Load() '窗体透明,控件不透明
Me.BackColor = &H0
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, &H0, 255, LWA_ALPHA or LWA_COLORKEY '这里的255是透明度,0-255之间
End Sub
这里设置成255,就是不透明,我们可以看到,但是窗体的背景被去掉了,
这样就控件可以看到,窗体看不到了.
这时候你把控件设置为你想整人的东西 比如一个picturebox里面装一坨Shit
如果还有疑问欢迎追问。
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_EX_LAYERED = &H80000
Const GWL_EXSTYLE = (-20)
Const LWA_ALPHA = &H2
Const LWA_COLORKEY = &H1
在窗体中这样调用:
程序代码
Private Sub Form_Load() '窗体透明,控件不透明
Me.BackColor = &H0
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, &H0, 255, LWA_ALPHA or LWA_COLORKEY '这里的255是透明度,0-255之间
End Sub
这里设置成255,就是不透明,我们可以看到,但是窗体的背景被去掉了,
这样就控件可以看到,窗体看不到了.
这时候你把控件设置为你想整人的东西 比如一个picturebox里面装一坨Shit
如果还有疑问欢迎追问。
追问
能留下您的QQ吗?或者加下我QQ296827066,以后在百度知道有问题可以M您^_^
追答
351894237 我把我私用的qq都给你了。 加qq时要注明你是谁喔
展开全部
FormDataAll_d = UploadStream_c.Read
CrLf_e = chrB(13)&chrB(10)
FormStart_f = InStrB(FormDataAll_d,CrLf_e)
FormEnd_g = InStrB(FormStart_f+1,FormDataAll_d,CrLf_e)
Set FormStream_h = Server.Createobject("ADODB.Stream")
FormStream_h.Type = 1
CrLf_e = chrB(13)&chrB(10)
FormStart_f = InStrB(FormDataAll_d,CrLf_e)
FormEnd_g = InStrB(FormStart_f+1,FormDataAll_d,CrLf_e)
Set FormStream_h = Server.Createobject("ADODB.Stream")
FormStream_h.Type = 1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不显示窗体啊?
直接 Me.visible=false就行了
直接 Me.visible=false就行了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Form1.Hide 手机党
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-01-24
展开全部
Private Declare Function icePub_regionGifFileDisp Lib "icePubDll.dll" (ByVal mHwmd As Long, ByVal strGifFilename As String, ByVal regionFlag As Integer) As Integer
Dim a2 As Integer
a2 = icePub_regionGifFileDisp(Me.hWnd, "e:\run.gif", 1)
Dim a2 As Integer
a2 = icePub_regionGifFileDisp(Me.hWnd, "e:\run.gif", 1)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
private declare function createcompatiblebitmap lib "gdi32" (byval hdc as long, byval nwidth as long, byval nheight as long) as long
private declare function selectobject lib "gdi32" (byval hdc as long, byval hobject as long) as long
private sub form_load()
dim bitmap
me.autoredraw = true
bitmap = createcompatiblebitmap(me.hdc, 0, 0)
selectobject me.hdc, bitmap
end sub使用api函数,透明化窗体。
忘记了,borderstyle
=
0,在窗口属性里设置才有效。
private declare function selectobject lib "gdi32" (byval hdc as long, byval hobject as long) as long
private sub form_load()
dim bitmap
me.autoredraw = true
bitmap = createcompatiblebitmap(me.hdc, 0, 0)
selectobject me.hdc, bitmap
end sub使用api函数,透明化窗体。
忘记了,borderstyle
=
0,在窗口属性里设置才有效。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询