ALX
Well-known member
It's possible that I'm trying to the impossible once again. My app has many panels and images that are too large for most displays, so of course I provide scroll bars, and every one of them has been given the ability to scroll up or down with the mouse wheel. All except for a PrintPreviewDialog that I've been fussing with trying to get it to scroll with the mouse wheel. 'Seems pretty straight forward to me...
 
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
... But it doesn't work. I can break inside of this sub and watch the VerticalScroll.Value changing, but nothing happens. Any thoughts ?
	
		
			
		
		
	
				
			
			
				VB.NET:
			
		
		
		Private Sub PPDMouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PrintPreviewDialog1.MouseWheel
        Dim j As Integer
        If e.Delta > 0 Then
            If PrintPreviewDialog1.VerticalScroll.Value < 1 Then Exit Sub
            j = PrintPreviewDialog1.VerticalScroll.Value - 15
            If j < 0 Then j = 0
        ElseIf e.Delta < 0 Then
            If PrintPreviewDialog1.VerticalScroll.Value >= PrintPreviewDialog1.VerticalScroll.Maximum Then Exit Sub
            j = PrintPreviewDialog1.VerticalScroll.Value + 15
            If j > PrintPreviewDialog1.VerticalScroll.Maximum Then j = PrintPreviewDialog1.VerticalScroll.Maximum
        End If
        PrintPreviewDialog1.VerticalScroll.Value = j
        PrintPreviewDialog1.Invalidate()
    End Sub
	... But it doesn't work. I can break inside of this sub and watch the VerticalScroll.Value changing, but nothing happens. Any thoughts ?