i use these code for catch the Top and Left of a control string Name(in a property):
what is strange is that i get an error message:Code:lngOldScrollObjectY = UserControl.Parent.Controls(strObjectScroll).Top lngOldScrollObjectX = UserControl.Parent.Controls(strObjectScroll).Left
"728 - is not legal control name"
and these property activate 1 timer. and in a timer i have these that don't gives me an error:
that's strange. how can i avoid that error?Code:If UserControl.Parent.Controls(strObjectScroll).Top > lngOldScrollObjectY Then ScrollingVertical.Value = ScrollingVertical.Value + UserControl.Parent.Controls(strObjectScroll).Top + lngOldScrollObjectY lngOldScrollObjectY = UserControl.Parent.Controls(strObjectScroll).Top ElseIf UserControl.Parent.Controls(strObjectScroll).Top < lngOldScrollObjectY Then ScrollingVertical.Value = ScrollingVertical.Value - UserControl.Parent.Controls(strObjectScroll).Top - lngOldScrollObjectY lngOldScrollObjectY = UserControl.Parent.Controls(strObjectScroll).Top ElseIf UserControl.Parent.Controls(strObjectScroll).Left > lngOldScrollObjectX Then ScrollingVertical.Value = UserControl.Parent.Controls(strObjectScroll).Left - lngOldScrollObjectX lngOldScrollObjectX = UserControl.Parent.Controls(strObjectScroll).Left ElseIf UserControl.Parent.Controls(strObjectScroll).Left < lngOldScrollObjectX Then ScrollingVertical.Value = UserControl.Parent.Controls(strObjectScroll).Left + lngOldScrollObjectX lngOldScrollObjectX = UserControl.Parent.Controls(strObjectScroll).Left End If
(these usercontrol is a container and these string control name is a control name that is inside of usercontrol)



Reply With Quote

