Scrolling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil Stanton

    Scrolling

    I have a form with an Image Allocation Plan

    Option Compare Database
    Option Explicit

    Dim AllocationPlanW idth As Long
    Dim AllocationPlanH eight As Long

    Private Sub AllocationPlan_ Click()

    If AllocationPlan. Width < Me.Width Then ' Normal size
    SpaceTypeID.Set Focus
    SpaceAllocation Sub.Visible = False
    LabelClickPictu re.Visible = False
    AllocationPlanW idth = AllocationPlan. Width
    AllocationPlanH eight = AllocationPlan. Height
    AllocationPlan. Width = Me.Width ' Expand
    AllocationPlan. Height = Me.Section(0).H eight
    Me.ScrollBars = 3
    Else
    SpaceAllocation Sub.Visible = True
    LabelClickPictu re.Visible = True
    AllocationPlan. Width = AllocationPlanW idth ' Restore to
    original
    AllocationPlan. Height = AllocationPlanH eight
    Me.ScrollBars = 0
    End If

    End Sub

    As you see from the above code, on clicking the image it enlarges, and on
    clicking again it restores it to the original size. I also have to hide a
    subform SpaceAllocation Sub to show the larger image.

    Interestingly ( and probably fortuitously) each time you do a pair of clicks
    the image gets a bit bigger. I suspect that the form size is changing.

    Problem is that with the bigger image I have to make the form's scrollbars
    visible. If you scroll down to the bottom left of the form, then click the
    image to restore it to the smaller size, I loose the top of the form.
    How can I ensure that I scroll to the Top Left before going to the smaller
    image?

    Phil


  • Stephen Lebans

    #2
    Re: Scrolling

    See the LoadJpegGif solution on my site for code to force the form's
    scrollbars back to home position.

    --

    HTH
    Stephen Lebans

    Access Code, Tips and Tricks
    Please respond only to the newsgroups so everyone can benefit.


    "Phil Stanton" <phil@myfamilyn ame.co.ukwrote in message
    news:lp6dnZRBvJ lr5afVnZ2dnUVZ8 qTinZ2d@posted. plusnet...
    >I have a form with an Image Allocation Plan
    >
    Option Compare Database
    Option Explicit
    >
    Dim AllocationPlanW idth As Long
    Dim AllocationPlanH eight As Long
    >
    Private Sub AllocationPlan_ Click()
    >
    If AllocationPlan. Width < Me.Width Then ' Normal size
    SpaceTypeID.Set Focus
    SpaceAllocation Sub.Visible = False
    LabelClickPictu re.Visible = False
    AllocationPlanW idth = AllocationPlan. Width
    AllocationPlanH eight = AllocationPlan. Height
    AllocationPlan. Width = Me.Width ' Expand
    AllocationPlan. Height = Me.Section(0).H eight
    Me.ScrollBars = 3
    Else
    SpaceAllocation Sub.Visible = True
    LabelClickPictu re.Visible = True
    AllocationPlan. Width = AllocationPlanW idth ' Restore to
    original
    AllocationPlan. Height = AllocationPlanH eight
    Me.ScrollBars = 0
    End If
    >
    End Sub
    >
    As you see from the above code, on clicking the image it enlarges, and on
    clicking again it restores it to the original size. I also have to hide a
    subform SpaceAllocation Sub to show the larger image.
    >
    Interestingly ( and probably fortuitously) each time you do a pair of
    clicks the image gets a bit bigger. I suspect that the form size is
    changing.
    >
    Problem is that with the bigger image I have to make the form's scrollbars
    visible. If you scroll down to the bottom left of the form, then click the
    image to restore it to the smaller size, I loose the top of the form.
    How can I ensure that I scroll to the Top Left before going to the smaller
    image?
    >
    Phil
    >
    >

    Comment

    • Phil Stanton

      #3
      Re: Scrolling

      Perfect

      Thanks a lot. I should have checked yout site first.

      Phil

      "Stephen Lebans" <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co m>
      wrote in message news:483b871f$0 $4030$9a566e8b@ news.aliant.net ...
      See the LoadJpegGif solution on my site for code to force the form's
      scrollbars back to home position.
      >
      --
      >
      HTH
      Stephen Lebans

      Access Code, Tips and Tricks
      Please respond only to the newsgroups so everyone can benefit.
      >
      >
      "Phil Stanton" <phil@myfamilyn ame.co.ukwrote in message
      news:lp6dnZRBvJ lr5afVnZ2dnUVZ8 qTinZ2d@posted. plusnet...
      >>I have a form with an Image Allocation Plan
      >>
      >Option Compare Database
      >Option Explicit
      >>
      > Dim AllocationPlanW idth As Long
      > Dim AllocationPlanH eight As Long
      >>
      >Private Sub AllocationPlan_ Click()
      >>
      > If AllocationPlan. Width < Me.Width Then ' Normal size
      > SpaceTypeID.Set Focus
      > SpaceAllocation Sub.Visible = False
      > LabelClickPictu re.Visible = False
      > AllocationPlanW idth = AllocationPlan. Width
      > AllocationPlanH eight = AllocationPlan. Height
      > AllocationPlan. Width = Me.Width ' Expand
      > AllocationPlan. Height = Me.Section(0).H eight
      > Me.ScrollBars = 3
      > Else
      > SpaceAllocation Sub.Visible = True
      > LabelClickPictu re.Visible = True
      > AllocationPlan. Width = AllocationPlanW idth ' Restore to
      >original
      > AllocationPlan. Height = AllocationPlanH eight
      > Me.ScrollBars = 0
      > End If
      >>
      >End Sub
      >>
      >As you see from the above code, on clicking the image it enlarges, and on
      >clicking again it restores it to the original size. I also have to hide a
      >subform SpaceAllocation Sub to show the larger image.
      >>
      >Interestingl y ( and probably fortuitously) each time you do a pair of
      >clicks the image gets a bit bigger. I suspect that the form size is
      >changing.
      >>
      >Problem is that with the bigger image I have to make the form's
      >scrollbars visible. If you scroll down to the bottom left of the form,
      >then click the image to restore it to the smaller size, I loose the top
      >of the form.
      >How can I ensure that I scroll to the Top Left before going to the
      >smaller image?
      >>
      >Phil
      >>
      >>
      >
      >

      Comment

      Working...