I agree with mdm20 that the only way to get to the Textbox
is by traversing up to the parent. In fact, here is a link to the same question asked a couple of years ago, with the same answer. If you want to limit unnecessary tree traversal, then you could stop searching once you hit the ListViewItem
, as anything above that point is not what you are looking for anyway.
However, add the last link and this one together, and it actually seems to me that you already have your answer. If a TextBoxView
is returned, then you know that a textbox was hit. You could even cache the incoming TextBox
that goes through the HitTestFilterCallBack
potentially, but that is more of a theory and possibly bug prone. However, going down that path, you could just test if the TextBox
coming through the filter is the parent of the TextBoxView