473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Scrolling

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
Jun 27 '08 #1
2 2127
See the LoadJpegGif solution on my site for code to force the form's
scrollbars back to home position.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Phil Stanton" <ph**@myfamilyname.co.ukwrote in message
news:lp******************************@posted.plusn et...
>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


Jun 27 '08 #2
Perfect

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

Phil

"Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdot...@linvalid.com>
wrote in message news:48**********************@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
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Phil Stanton" <ph**@myfamilyname.co.ukwrote in message
news:lp******************************@posted.plusn et...
>>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



Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Midas NDT Sales | last post by:
I have been looking at a simple example of a scrolling text box (the one in the SAM book) as below: <script language="JavaScript"> var pos=100; function Scroll() { if...
1
by: Kirk | last post by:
Is it possible to stop horizontal scrolling whilst still maintaining vertical scrolling within an <IFRAME> ? Within each page of my site I have an IFRAME for content. For some pages there is...
44
by: Jim M | last post by:
I have had great success with using <iframe> with overflow-y set to auto. I can get a similar look with the <iframe> tag. BUT... In all cases I need to have fixed heights. Is there a way to...
1
by: Tim Frawley | last post by:
I have a large form with many controls, almost like legal size paper in height. Just so I can head these off, I am not looking for suggestions to the effect of using Tab controls, multi-window...
2
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a...
4
by: Keith Bentrup | last post by:
Hi all, I wrote a simple search function to find text in a textarea where not all the text is visible (ie. the text box displays 10 lines but there may be more than 1000 lines to search). I can...
1
by: atif | last post by:
Hi, I m new to CSharp.. so may be my preliminary questions look stupid.. but plz help me.. I want to drag controls like buttons or some other user controls over form.. i have set form's...
5
by: PythonistL | last post by:
I am a newbie with Javascript. I have this simple script for scrolling text <HTML> <HEAD> <TITLE>Scrolling Message Script</TITLE> <SCRIPT language="JavaScript"><!-- var msg = 'My scrolling...
3
by: Chamnap | last post by:
Hello everybody, I have one problem. I want to do something after the user finished scrolling. The scroll event fires whenever the user is scrolling. I don't want this actually. Does anyone has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.