Jump to content
Software FX Community

Scroll bar direction


thubble
 Share

Recommended Posts

I'm having a problem where I have a Gantt chart with a scroll bar on the X axis, and it is scrolling in the wrong direction. For instance, when the chart is first initialized, the points displayed are the top ones, but the scroll position is at the bottom. And when I move the scrollbar UP, it displays points farther down. I've tried putting a scrollbar on the Y axis and it works as expected.

When I look at the AxisX.ScrollPosition and AxisX.Scrollbar.Value at any given time, they seem to be opposite. For instance, if I have 40 points, and AxisX.ScrollPosition is 10, then AxisX.Scrollbar.Value will be 30.

Is there any way to reverse the direction of the scrollbar?

Thanks in advance.

Link to comment
Share on other sites

I found a way to fix this:

 If chtTest.AxisX.ScrollBar IsNot Nothing Then  AddHandler chtTest.AxisX.ScrollBar.ValueChanged, AddressOf AxisX_Scroll End If

 ...

Private Sub AxisX_Scroll(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) chtTest.AxisX.ScrollPosition = chtTest.AxisX.ScrollBar.ValueEnd Sub

Is there an easier/more elegant way to do this, though?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...