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