now i'm trying build a 2D Level Editor ActiveX control.
my 1st problem is for put the scroll bars in UC.
heres the code:
Code:
If vNewValue = ScrlBars Then Exit Property
    'for showing the scroll bars, the UC is resized
    If vNewValue = None Then
        ScrollingHorizontal.Visible = False
        ScrollingVertical.Visible = False
        'put the scroll bars outside of UC
        UserControl.Width = UserControl.Width - ScrollingHorizontal.Height
        UserControl.Height = UserControl.Height - ScrollingVertical.Width
        ScrollingHorizontal.Top = UserControl.Height + 100
        ScrollingVertical.Left = UserControl.Width + 100
    ElseIf vNewValue = Horizontal Then
        ScrollingHorizontal.Visible = True
        ScrollingVertical.Visible = False
        'put the horizontal scroll bar in right position
        'and the other outside of it
        UserControl.Width = UserControl.Width + ScrollingHorizontal.Height
        UserControl.Height = UserControl.Height - ScrollingVertical.Width
        ScrollingHorizontal.Top = (UserControl.Height - ScrollingHorizontal.Width) * Screen.TwipsPerPixelY
        ScrollingVertical.Left = UserControl.Width + 100
    ElseIf vNewValue = Vertical Then
        ScrollingHorizontal.Visible = False
        ScrollingVertical.Visible = True
        'put the vertical scroll bar in right position
        'and the other outside of it
        UserControl.Width = UserControl.Width - ScrollingHorizontal.Height
        UserControl.Height = UserControl.Height + ScrollingVertical.Width
        ScrollingHorizontal.Top = UserControl.Height + 100
        ScrollingVertical.Left = (UserControl.Width - ScrollingHorizontal.Height) * Screen.TwipsPerPixelX
    ElseIf vNewValue = Both Then
        If ScrlBars = Both Then Exit Property
        ScrollingHorizontal.Visible = True
        ScrollingVertical.Visible = True
        'put both scroll bars in right position
        UserControl.Width = UserControl.Width + ScrollingHorizontal.Height
        UserControl.Height = UserControl.Height + ScrollingVertical.Width
        ScrollingHorizontal.Top = (UserControl.Height - ScrollingHorizontal.Width) * Screen.TwipsPerPixelY
        ScrollingVertical.Left = (UserControl.Width - ScrollingHorizontal.Height) * Screen.TwipsPerPixelX
    End If
    ScrlBars = vNewValue
the scrolling bars aren't in right position, can anyone tell me what isn't right?
thanks