Solved

WPF ListView Scrollviewer

Posted on 2014-04-08
1
538 Views
Last Modified: 2014-04-08
How do I access a WPF ListView's ScrollViewer through VB.NET? All the examples I can find online are C# and I'm having problems translating these into VB.NET ... Some of the syntax doesn't make sense to me. Sorry....

P
0
Comment
Question by:WernerVonBraun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
WernerVonBraun earned 0 total points
ID: 39987019
Never mind... I figured out a solution:

    Public Shared Function GetListViewScrollViewer(ByVal oLV As ListView) As ScrollViewer
        Dim oDO As DependencyObject
        oDO = TryCast(oLV, DependencyObject)

        Return GetScrollViewer(oLV)

    End Function

    Public Shared Function GetScrollViewer(ByVal oDO As DependencyObject) As ScrollViewer

        Dim nChild As Integer
        Dim oDOChild As DependencyObject
        Dim oSV As ScrollViewer
        For nChild = 0 To VisualTreeHelper.GetChildrenCount(oDO) - 1
            oDOChild = VisualTreeHelper.GetChild(oDO, nChild)
            oSV = TryCast(oDOChild, ScrollViewer)
            If Not oSV Is Nothing Then
                Return oSV
            End If
            oSV = GetScrollViewer(oDOChild)
            If Not oSV Is Nothing Then
                Return oSV
            End If
        Next

        Return Nothing
    End Function

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question