1
我想获取Button的父项的父项。我能够得到父母使用如何获得wpf按钮的父项的父项
Dim tempB As Button = CType(sender, Button)
Dim g1 As Grid = CType(tempB.Parent, Grid)
(在我的点击处理程序)。但是,如果我做
Dim g2 As New Object
g2 = g1.Parent
tempB.Content = g2.GetType
我得到一个NullReference Exception