Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VScrollbar1.value = 0

Status
Not open for further replies.

lrfcbabe

Programmer
Jul 19, 2001
108
US
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.
 
TBox.Text = nuggets

Because you should never scroll an image on a chicken.


That is about how confusing your question is. I'm going to hope it is safe to assume that it is a vertical scroll bar without the actual error all I can say is make sure the minimum is set to 0. If it is set to 1 and you try to force the value to 0 it will cause an error. Generally the error should tell you that though so without the error I can't give you any better ideas.

As to the second part a lot more information is going to be needed. What the image is in/on (picture box on a form or background image on a panel) and what code you are using to "scroll".

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top