
正文
vb.net异形窗口,windows异形窗口
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
VB.NET中,如何动态创建非模态窗体,类似于QQ一样,双击一个头像会弹出一个窗口。
做一个窗体模板,假设是Form2
Dim x as New Form2
x.Show()
如果弹出窗口较多,x可以用动态数组替代
相关问答
Q1: vb.net 模式窗口
用ShowDialog()打开窗体,对话框用msgBox()或者MessageBox()都是模式的。
Q2: 如何用VB做异形窗体
Option Explicit
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Sub Form_Resize()
Const RGN_DIFF = 4
Dim outer_rgn As Long
Dim inner_rgn As Long
Dim combined_rgn As Long
Dim wid As Single
Dim hgt As Single
Dim border_width As Single
Dim title_height As Single
If WindowState = vbMinimized Then Exit Sub
' Create the regions.
wid = ScaleX(Width, vbTwips, vbPixels)
hgt = ScaleY(Height, vbTwips, vbPixels)
outer_rgn = CreateRectRgn(0, 0, wid, hgt)
border_width = (wid - ScaleWidth) / 2
title_height = hgt - border_width - ScaleHeight
inner_rgn = CreateEllipticRgn( _
border_width + ScaleWidth * 0.1, _
title_height + ScaleHeight * 0.1, _
ScaleWidth * 0.9, ScaleHeight * 0.9)
' Subtract the inner region from the outer.
combined_rgn = CreateRectRgn(0, 0, 0, 0)
CombineRgn combined_rgn, outer_rgn, _
inner_rgn, RGN_DIFF
' Restrict the window to the region.
SetWindowRgn hWnd, combined_rgn, True
End Sub
Q3: vb6.0中能否实现像千千静听皮肤那样的指定色透明的功能?
用这个函数没错。
你的hwnd没有写清楚,这样hwnd是没定义的,要指定具体窗体的hwnd,如form1.hwnd
rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, H80C0FF, 0, LWA_COLORKEY
中的hwnd参数,全部改成 me.hwnd ,即当前窗口的hwnd
Q4: VB.NET中怎么实现双屏显示不同的窗体
两个显示器显示有两种模式,一种是
双屏
复制,另一种是扩展。
你这个只能用第二种方式。你需要把要在另一个显示器上显示的窗体的Location设置在主显示器全屏时的右边就可以了.其实就是桌面的向右延伸。
在主显示上拖一下窗体就明白了!







