Private void listbox#mousemove (Object sender, mouseeventargs e) {If (result [0] = "1 ") {// obtain the subtype of ListBox: scrollviewer = findchildoftype <scrollviewer> (ListBox) sender); If (scrollviewer = NULL) {Throw new invalidoperationexception ("erro ");} else {// determine whether the current rolling height is greater than or equal to the actual rolling height of scrollviewer. If it is equal to or greater than the actual rolling height, it proves that if (scrollviewer. verticaloffset + 1)> = scrollviewer. scrollableheight) {MessageBox. show ("AAA") ;}}}// obtain the subtype public static t findchildoftype <t> (dependencyobject root) where T: class {var queue = new queue <dependencyobject> (); queue. enqueue (Root); While (queue. count> 0) {dependencyobject current = queue. dequeue (); For (INT I = visualtreehelper. getchildrencount (current)-1; 0 <= I; I --) {var child = visualtreehelper. getchild (current, I); var typedchild = CH ILD as t; If (typedchild! = NULL) {return typedchild;} queue. enqueue (child) ;}} return NULL ;}