Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / May 2008

Tip: Looking for answers? Try searching our database.

Scrolling

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Stanton - 26 May 2008 09:46 GMT
I have a form with an Image Allocation Plan

Option Compare Database
Option Explicit

   Dim AllocationPlanWidth As Long
   Dim AllocationPlanHeight As Long

Private Sub AllocationPlan_Click()

   If AllocationPlan.Width < Me.Width Then         ' Normal size
       SpaceTypeID.SetFocus
       SpaceAllocationSub.Visible = False
       LabelClickPicture.Visible = False
       AllocationPlanWidth = AllocationPlan.Width
       AllocationPlanHeight = AllocationPlan.Height
       AllocationPlan.Width = Me.Width                 ' Expand
       AllocationPlan.Height = Me.Section(0).Height
       Me.ScrollBars = 3
   Else
       SpaceAllocationSub.Visible = True
       LabelClickPicture.Visible = True
       AllocationPlan.Width = AllocationPlanWidth      ' Restore to
original
       AllocationPlan.Height = AllocationPlanHeight
       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 SpaceAllocationSub 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 - 27 May 2008 04:59 GMT
See the LoadJpegGif solution on my site for code to force the form's
scrollbars back to home position.

Signature

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

>I have a form with an Image Allocation Plan
>
[quoted text clipped - 41 lines]
>
> Phil
Phil Stanton - 27 May 2008 09:33 GMT
Perfect

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

Phil

> See the LoadJpegGif solution on my site for code to force the form's
> scrollbars back to home position.
[quoted text clipped - 45 lines]
>>
>> Phil
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.