Solved

WPF ListView Scrollviewer

Posted on 2014-04-08
1
509 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
1 Comment
 
LVL 4

Accepted Solution

by:
WernerVonBraun earned 0 total points
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now