我正在编写一个函数,它将采用Control Ctrl
asArguement
并修改Control.Content
它。有没有办法获取和设置Content
任何Control
?
代码 :
void RemoveHotKey(Control Ctrl, int KeyIndex)
{
if (Ctrl.Content.ToString().Substring(KeyIndex, 1) == "_") // System.Windows.Controls.Control does not contain a definition for 'Content'
{
Ctrl.Content = Ctrl.Content.ToString().Remove(KeyIndex, 1); // System.Windows.Controls.Control does not contain a definition for 'Content'
}
}