Code:
Private Sub UpperBound_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpperBound.ValueChanged
If loading = 1 Then
Exit Sub
End If
Dim currentvalue As Decimal
currentvalue = UpperBound.Value + 0.5
If currentvalue <= LowerBound.Value Then
UpperBound.Value = currentvalue
Else
ExportChart.ChartAreas(0).AxisX.Maximum = UpperBound.Value
End If
ExportDataGrid.RowCount = 3
For row As Integer = 0 To MainForm.DataGrid.RowCount - 1
If MainForm.DataGrid.Rows(row).Cells(1).Value > LowerBound.Value Then
If MainForm.DataGrid.Rows(row).Cells(1).Value < UpperBound.Value Then
ExportDataGrid.Rows(row).Cells(0).Value = MainForm.DataGrid.Rows(row).Cells(1).Value
ExportDataGrid.Rows(row).Cells(1).Value = MainForm.DataGrid.Rows(row).Cells(2).Value
ExportDataGrid.Rows(row).Cells(2).Value = MainForm.DataGrid.Rows(row).Cells(3).Value
ExportDataGrid.RowCount = ExportDataGrid.RowCount + 1
End If
End If
Next
End Sub
Private Sub LowerBound_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LowerBound.ValueChanged
If loading = 1 Then
Exit Sub
End If
Dim currentvalue As Decimal
currentvalue = LowerBound.Value - 0.5
If currentvalue >= UpperBound.Value Then
LowerBound.Value = currentvalue
Else
ExportChart.ChartAreas(0).AxisX.Minimum = LowerBound.Value
End If
ExportDataGrid.RowCount = 1
For row As Integer = 0 To MainForm.DataGrid.RowCount - 1
If MainForm.DataGrid.Rows(row).Cells(1).Value > LowerBound.Value Then
If MainForm.DataGrid.Rows(row).Cells(1).Value < UpperBound.Value Then
ExportDataGrid.Rows(row).Cells(0).Value = MainForm.DataGrid.Rows(row).Cells(1).FormattedValue
ExportDataGrid.Rows(row).Cells(1).Value = MainForm.DataGrid.Rows(row).Cells(2).FormattedValue
ExportDataGrid.Rows(row).Cells(2).Value = MainForm.DataGrid.Rows(row).Cells(3).FormattedValue
ExportDataGrid.RowCount = ExportDataGrid.RowCount + 1
End If
End If
Next
End Sub
Ryan