void IScrollItemProvider.ScrollIntoView() { // Make sure that the control is enabled if (!SafeNativeMethods.IsWindowEnabled(_hwnd)) { throw new ElementNotEnabledException(); } // Currently this ignores the alignToTop, as there is no easy way to set something to the bottom of a listbox if (!WindowsListView.Scrollable(_hwnd)) { throw new InvalidOperationException(SR.Get(SRID.OperationCannotBePerformed)); } // ensure item vertical visibility WindowsListView.EnsureVisible(_hwnd, _item, false); }
// Same as clicking on a list item. void IInvokeProvider.Invoke() { // Make sure that the control is enabled if (!SafeNativeMethods.IsWindowEnabled(_hwnd)) { throw new ElementNotEnabledException(); } if (WindowsListView.Scrollable(_hwnd)) { // ensure item vertical visibility WindowsListView.EnsureVisible(_hwnd, _item, true); } NativeMethods.Win32Point clickPoint; // try to obtaine the clickable point if (!GetListviewitemClickablePoint(out clickPoint)) { throw new InvalidOperationException(SR.Get(SRID.OperationCannotBePerformed)); } Click(clickPoint); }