General discussion

Locked

Visual Basic programming question

By cgreene ·
I am using MSChart to graph data that i receive using my program. the user can download anywhere from 1 to 1000 data points then graph. My question is that this number 1, to 1000 whatever the usere chooses, is my x axis. well, when there are only 10 data points, the axis is very clear , but if there are 1000, then all 1000 data points are crammed on one page. I want to know if there is code to put a scroll bar for the x axis where say 10 points are shown at a time, or some way so that i can have a min. number of
values at a time for the x axis range.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Visual Basic programming question

by Cedric King In reply to Visual Basic programming ...

Public Sub ScrollForm()
Dim CtrlControl As Control

For Each CtrlControl In Me.Controls
If CtrlControl.Tag <> "NoScroll" And Not (TypeOf CtrlControl Is VScrollBar) Then
CtrlControl.Top = CtrlControl.Top - intLastPoz + VScroll1.Value
End If
Next
intLastPoz = VScroll1.Value
End Sub
Private Sub VScroll1_Change()
ScrollForm
End Sub
Private Sub VScroll1_Scroll()
ScrollForm
End Sub

Private Sub Form_Load()
' Below are codesfor the scrollbar
intFullHeight = 5000
intDisplayHeight = CurrentY + 1050

Me.Height = intDisplayHeight

With VScroll1
.Height = Me.ScaleHeight
.Min = 0
.Max = intFullHeight - intDisplayHeight
.SmallChange = Screen.TwipsPerPixelX * 10
.LargeChange = .SmallChange
.Visible = DisplayScroll
End With
End Sub

Every controls that you do not want to scroll, you place a "NoScroll" in that controls' Tag. Hope youcan see and understand the code.

Collapse -

Visual Basic programming question

by cgreene In reply to Visual Basic programming ...

Poster rated this answer

Collapse -

Visual Basic programming question

by cgreene In reply to Visual Basic programming ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums