This is my VB6 code and it works fine.
If Image2.Height > Screen.Height Then
VScroll1.Visible = True
VScroll1.Value = 0
' Vscroll1.setfocus
Else
VScroll1.Visible = False
End If
This is my 2008 code that is breaking out when it reaches the VScroll1.Value = 0 statement.
If VB6.FromPixelsUserHeight(Image2.Height, 12615, 841) > VB6.PixelsToTwipsY(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) Then
VScroll1.Visible = True
VScroll1.Value = 0
' VScroll1.SetFocus
else
VScroll1.Visible = False
End If
If I omit the line then it will work but my scroll value is set wrong and when I scroll the image is not stopping when the top reaches the top of the screen. It will scroll farther than I(in VB6) intended.
If Image2.Height > Screen.Height Then
VScroll1.Visible = True
VScroll1.Value = 0
' Vscroll1.setfocus
Else
VScroll1.Visible = False
End If
This is my 2008 code that is breaking out when it reaches the VScroll1.Value = 0 statement.
If VB6.FromPixelsUserHeight(Image2.Height, 12615, 841) > VB6.PixelsToTwipsY(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) Then
VScroll1.Visible = True
VScroll1.Value = 0
' VScroll1.SetFocus
else
VScroll1.Visible = False
End If
If I omit the line then it will work but my scroll value is set wrong and when I scroll the image is not stopping when the top reaches the top of the screen. It will scroll farther than I(in VB6) intended.