Resize Window Based Upon Photo Size - August 2013
I have an application that shows an enlarged photo in a popup window when the client clicks the photo's thumbnail. I wondered if I could develop some code to allow the client to click a 'Next' or 'Previous' button to show the next/previous photo in the collection. They could 'scroll' through the collection not having to close the popup, click another thumbnail, etc. The key element in the process is to resize the window based upon the photo's size.
I searched the web and found the resizeTo function. With some trial and error I was able to use the function to resize the open window when the Next or Previous buttons are clicked. I created a demo application and made it the August 2013 tip-of-the-month. Click here to run the demo.
The Asp.Net, VB.Net, VS/2008 project ResizeWindowBasedUponPhotoSize is documented here. The client clicks on one of the thumbnails to display the full size photo in a popup window.
Click one of the thumbnails.
The selected photo is shown in a popup window.
Click 'Previous' or 'Next' to show the previous/next photo in the collection.
Click 'Close' or click on the photo to close the window.
The GetResizeTo Function sets the OnClientClick
The GetResizeTo Function
Download the source code by clicking on the zipped file name. Click here to run the demo application.
Download - Source Zipped File Size VS/2008 VB.Net, ASP.Net Solution ResizeWindowBasedUponPhotoSize.zip 1,150K
Previous Tip Tip Index Next Tip