作者在 2009-07-07 10:39:26 发布以下内容
Function GetControl(x1 As Single, y1 As Single.错误提示此处因为标识符是什么意思啊
x2 as Single, y2 as Single) As Control
Dim Control As Control
For Each Control In Form1
With Control
If (x1 〈= .Left) And (x2 〉= .Left) And _
(y1 〈= .Top) And (y2 〉= .Top) Or _
(x1 〈=.Left + Width) And (x2 〉= .Left + Width) And _
(y1 〈= .Top) And (y2 〉= .Top) Or _
(x1 〈= .Left) And (x2 〉= Left) And _
(y1 〈= .Top + Height) And (y2 〉= .Top + Height) Or _
(x1 〈= . Left + Width) And (x2 〉= .Left + Width) And _
(y1 〈= .Top + Height) And (y2 〉= .Top + Height) Then
GetControl = Control
Exit Function
End If End With
Next
GetControl = Nothing
End Function
x2 as Single, y2 as Single) As Control
Dim Control As Control
For Each Control In Form1
With Control
If (x1 〈= .Left) And (x2 〉= .Left) And _
(y1 〈= .Top) And (y2 〉= .Top) Or _
(x1 〈=.Left + Width) And (x2 〉= .Left + Width) And _
(y1 〈= .Top) And (y2 〉= .Top) Or _
(x1 〈= .Left) And (x2 〉= Left) And _
(y1 〈= .Top + Height) And (y2 〉= .Top + Height) Or _
(x1 〈= . Left + Width) And (x2 〉= .Left + Width) And _
(y1 〈= .Top + Height) And (y2 〉= .Top + Height) Then
GetControl = Control
Exit Function
End If End With
Next
GetControl = Nothing
End Function