关于control.tag的问题!!
Sub RecursionControl(ByVal control As Control, ByVal resize As Boolean)
If control.HasChildren Then
Dim c As Control
For Each c In control.Controls
RecursionControl(c, resize)
Next
End If
If control IsNot Me Then
With control
If resize Then
Dim scale As Single = Me.Width / Val(Me.Tag)
Dim sp() As String = Split(.Tag, "|") '为什么会有坐标与尺寸的数据在里面? .Left = scale * Val(sp(0))
.Top = scale * Val(sp(1))
.Width = scale * Val(sp(2))
.Height = scale * Val(sp(3))
Else
.Tag = .Left & "| " & .Top & "| " & .Width & "| " & .Height
End If
End With
End If
End Sub
我msdn也没有相关的解释,请大神指点一下!!问题在代码中!! vb tag属性
[解决办法]
Tag是个什么内涵都没有定义的东西,它只是随便定义一个object类型的属性而已,你可以把任何对象赋值给它。这就好像假设一个游客背一个书包,里边可能装了吃的,也可能装了杀人工具,是他自己装进去的。
因此你要全文搜索一下,看看哪里有给Tag赋值的语句,看懂这个逻辑流程(那里赋值和这里取值)。只能问你自己,别人无法告诉你。