我正在try 在WinForm应用程序中创建组件类椭圆形使得在www.example.com中没有响应
我在另一台电脑上试过了,还是一样
使其不响应并重新启动Visual Studio.密码有什么问题吗?请带我
谢谢
Imports System.ComponentModel
Imports System.Runtime.InteropServices
Public Class Ellipse
Inherits Component
<DllImport("gdi32.dll", EntryPoint:="CreateRoundRectRgn")>
Private Shared Function CreateRoundRectRgn(ByVal nL As Integer, ByVal nT As Integer, ByVal nR As Integer, ByVal nB As Integer, ByVal nWidthEllipse As Integer, ByVal nHeightEllipse As Integer) As IntPtr
End Function
Private control As Control
Private cornerRadius As Integer = 25
Public Property TargetControl As Control
Get
Return control
End Get
Set(ByVal value As Control)
control = value
AddHandler control.SizeChanged, Sub(sender, eventArgs) control.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, control.Width, control.Height, cornerRadius, cornerRadius))
End Set
End Property
Public Property CornerRedius As Integer
Get
Return CornerRedius
End Get
Set(ByVal value As Integer)
CornerRedius = value
If control IsNot Nothing Then
control.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, control.Width, control.Height, cornerRadius, cornerRadius))
End If
End Set
End Property
End Class
当我将corner radius值从0更改为25时,它变得没有响应,Visual Studio重新启动.