Dim d As Boolean
If m.Msg = H100 Or m.Msg = H104 Then d = True Else If m.Msg = H101 Or m.Msg = H105 Then d = False Else Return MyBase.ProcessKeyPreview(m)
If KeyCode = Keys.ShiftKey Then
shift = d
ElseIf KeyCode = Keys.Menu Then
alt = d
End If
Return MyBase.ProcessKeyPreview(m)
End Function
Protected Overrides Sub OnPaint(e As PaintEventArgs)
MyBase.OnPaint(e)
For Each c As Control In IIf(editting Is Nothing, selected, editting)
e.Graphics.DrawRectangle(New Pen(Color.Gray) With {.DashStyle = Drawing2D.DashStyle.DashDot}, c.Left - 1, c.Top - 1, c.Width + 1, c.Height + 1)
Next
If (down.X0) Then e.Graphics.DrawRectangle(New Pen(Color.Gray) With {.DashStyle = Drawing2D.DashStyle.DashDot}, rect)
End Sub
End Class
VB.net GetWindowRect 问题把这个函数改成这样就好vb.netrect了Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Integer, ByRef lpRect As RECT) As Integer
vb.net,dim rects as rectangle()()={a,b , c,d,e,f} 我忘了双小括号的Dim a As New System.Drawing.Rectangle(2 , 1 , 20,40)
Dim b As New System.Drawing.Rectangle(4,4,40,30)
Dim c As New System.Drawing.Rectangle(6,7,60,20)
Dim dAs NewSystem.Drawing.Rectangle(8,10,80,10)
Dim rectabcd = {a, b, c, d} ''数组(a、b、c、d)
Public Sub 调用组()
rectabcd.GetValue(2) ''获取rectabcd{c}返回值 Object 。
……ListRect.Item(2).Height
rectabcd.ToList.Item(0)''获取或设置rectabcd.ToList[a]的值 。
End Sub
Public ListRect As List(Of Drawing.Rectangle) = {New Rectangle(0, 0, 10, 10), New Rectangle(10, 1, 20, 20)}.ToList ''ListRect共2个Rectangle 。
VB.NET想用GetWindowRECT获取某窗口的坐标 , 但测试结果是L,T,R,B显示都是0,0,0,0很简单,原因有二 。第一,VB里long是32位 , 但是VB.NET里是64位,Dim ksWND As Integer才对 。第二,VB在API里默认传址,而VB.NET默认传值,所以API里要添加Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long,添加"ByRef"lpRect As RECT) As Integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long,byref lpRect As RECT) As Integer
Private Structure RECT
Dim Left As Integer
Dim Top As Integer
Dim Right As Integer
Dim Bottom As Integer
End Structure
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim ksWND As integer
Dim ksTitle As String
Dim winS As RECT
If TextBox1.Text"" Then
ksTitle = TextBox1.Text
ksWND = FindWindow(vbNullString, ksTitle)
GetWindowRect(ksWND, winS)
MsgBox("左上角坐标("winS.Left","winS.Top")"vbCrLf"右下角坐标("winS.Right","winS.Bottom")"vbCrLf"窗口高"winS.Bottom - winS.Top"窗口宽"winS.Right - winS.Left)
Else
MsgBox("请填写窗口名称")
End If
End Sub
关于vb.netrect和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
- redis的热点数据缓存 redis热点数据切换
- 如何修改戴尔服务器的IP地址? 戴尔服务器ip地址怎么改
- mysql中ext
- 优惠券功能的业务流程设计图谱 优惠券redis处理
- redis通配符的使用
- redis是开发工具吗 redis的开发人是谁
- mysql备份一个表的数据 备份一个mysql库
- mysql中删除记录的命令 mysql删除中继日志
- mysql 判断 mysql的判断语句
- 屏蔽数据库的复杂性 mysql数据库屏蔽权限
