如何使窗体左下角和右下脚变成圆角,左上角和右上角保持方角不变?谢谢!
解决方案 »
- vb.net datagrid控件中无法显示access数据库中的时间
- 都来看看,能解决我的问题给你糖吃!
- 我想写一个接口程序,读取“地磅称”中显示的数据,请高手指点该如何下手?
- VB问题,十万火急!!!!!!!!!@_@!~~~~~~~~
- vb如何改变fastreport的数据连接
- VB.net2005 怎样获取当前的系统
- 关于:至少一个参数未被指定值的问题
- about VSFlexgrid...help!!
- 自己做的控件怎么会过期????
- 关于ado实现select into 导出DBF和DB表不能显示中文的问题
- vb中操作mysql问题……小问题。不担大家时间
- 请问那里可以下载关于网络资源占用的源代码。
使用 setform me'圆角的窗体
Public Sub SetForm(frmObject As Form)
Dim FormArrary() As COORD
Dim hRgn As Long
Dim I As Long
Dim lngWidthPix As Long
lngWidthPix = frmObject.Width / Screen.TwipsPerPixelX
ReDim FormArrary(15)
FormArrary(0).x = 0
FormArrary(0).Y = 5
FormArrary(1).x = 1
FormArrary(1).Y = 4
FormArrary(2).x = 1
FormArrary(2).Y = 3
FormArrary(3).x = 2
FormArrary(3).Y = 2
FormArrary(4).x = 3
FormArrary(4).Y = 1
FormArrary(5).x = 4
FormArrary(5).Y = 1
FormArrary(6).x = 5
FormArrary(6).Y = 0
FormArrary(7).x = lngWidthPix - 5
FormArrary(7).Y = 0
FormArrary(8).x = lngWidthPix - 4
FormArrary(8).Y = 1
FormArrary(9).x = lngWidthPix - 3
FormArrary(9).Y = 1
FormArrary(10).x = lngWidthPix - 2
FormArrary(10).Y = 2
FormArrary(11).x = lngWidthPix - 1
FormArrary(11).Y = 3
FormArrary(12).x = lngWidthPix - 1
FormArrary(12).Y = 4
FormArrary(13).x = lngWidthPix
FormArrary(13).Y = 5
FormArrary(14).x = lngWidthPix
FormArrary(14).Y = frmObject.Height / Screen.TwipsPerPixelY
FormArrary(15).x = 0
FormArrary(15).Y = frmObject.Height / Screen.TwipsPerPixelY
hRgn = CreatePolygonRgn(FormArrary(0), 16, ALTERNATE)
SetWindowRgn frmObject.hwnd, hRgn, True
DeleteObject hRgn
End Sub
private type COORD
x as long
y as long
end type
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SPI_GETWORKAREA = 48
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Public Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal Y As Long) As Long
Public Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Dim CurRgn, TempRgn As Long
Public Enum states
Normal = 0
Disable = 1
ReadOnly = 2
End Enum
Public Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As Any, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Const ALTERNATE = 1
Private Type COORD
x As Long
Y As Long
End Type