现在的位置: 首页 > 综合 > 正文

ListBox Double click in WPF

2014年02月16日 ⁄ 综合 ⁄ 共 285字 ⁄ 字号 评论关闭

 

 

 

 

 

 

 

 

ListBox ctlList = sender as ListBox

;

 

 

UIElement elem = (UIElement)ctlList.InputHitTest( e.GetPosition( ctlList

) );

 

 

while ( elem != ctlList

)

{

 

 

if ( elem is ListBoxItem

)

{

 

 

rd = ((ListBoxItem)elem).Content as Record;

// Handle the double click here

 

 

break

;

}

 

 

elem = (UIElement)VisualTreeHelper.GetParent( elem

);

抱歉!评论已关闭.