Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Resizing Gadgets using the Larger Size/Smaller Size Button

28 Jul 2010   #1

W7 Enterprise x64
Resizing Gadgets using the Larger Size/Smaller Size Button

I'm wanting to resize my gadget I developed with the Larger Size/Smaller button. Currently, I have two separate main gadget html files. The only difference between them is the background image, size, and the orientation of the icons.

I noticed other built-in gadgets like Weather and CPU meter have this option, but I do not know how to adapt that to my gadget

I attached screen shots of my gadget (both have the flyout showing) so you can see the size difference.

Attached Thumbnails
Resizing Gadgets using the Larger Size/Smaller Size Button-imonscreenshot.png   Resizing Gadgets using the Larger Size/Smaller Size Button-bigimonscreenshot.png  
Attached Images
Resizing Gadgets using the Larger Size/Smaller Size Button-largetsizebutton.png 
My System SpecsSystem Spec
28 Jul 2010   #2

Windows 7 Ultimate x64 SP1

Referring to the docked and floating states?

This might give you some idea to start with.

System.Gadget.onDock Event (Windows)
System.Gadget.onUndock Event (Windows)
System.Gadget Object (Windows)
My System SpecsSystem Spec
29 Jul 2010   #3

W7 Enterprise x64

 System.Gadget.onUndock = checkState;
 System.Gadget.onDock = checkState;
I have this in my js file to execute when the gadget opens, but I'm not sure this is working.

function checkState(){
 if (!System.Gadget.docked){ 
  with (
  width = "200px";
  height = "255px";
 } = "200px"; = "255px";
 background.src = "url(img/iMonBackground200.png.png)";
 else if(System.Gadget.docked){
  with (
  width = "130px";
  height = "166px";
 } = "130px"; = "166px";
 background.src = "url(img/iMonBG.png)";

This is the rest of the code in my js file. What do I need to do in my HTML file? Do I need to get rid of the background path and let the js file assign it?

EDIT: It is working now, I had the line

System.Gadget.visibilityChanged = checkVisibility;
but no function associated with it. Got rid of the line, and it works!
My System SpecsSystem Spec


 Resizing Gadgets using the Larger Size/Smaller Size Button

Thread Tools

Similar help and support threads
Thread Forum
list all files, by size, larger than a specified size?
I am running out of space on my system drive (120GB SSD with < 6GB remaining). It happened in only 12 months. I'd like to know where all that space went, which files are using it. So I'm looking for a way to rank files by size regardless of their folder location, largest-to-smallest, ideally...
Performance & Maintenance
How to fix caption button size smaller than 18 ?
Hi. I found a bug in explorer, which resets caption button size to 18 (if you use smaller size) when you use fullscreen applications (games). It may seem like a trivial issue but I think those icons are still too big and ugly when using value 18. Is there a way to fix it, somehow set it to 14...
Themes and Styles
SSD smaller then Original Size ?
I installed a 60 gig SSD realizing it is too small after windows says there is only 55 gigs on the SSD instead of 60 ? After doing some reading, this is considered normal ?
Hardware & Devices
Resizing Window Size
Hi everybody sorry if that has been posted before :( Simple question really is there a F button or some other combination that will open a window to it's maximum viewing size? I am so fed up of stretching it wide with the mouse :( TIA :) Steve
General Discussion
WMP 12 - resizing window size
every time i start to play a video, WMP starts in a small 3x5ish window... I rre-size and make it bigger, close WMP, and start the video again, and it never ever remembers the previous size... for some of the higher resolution videos (HD and Blueray) WMP opens a bigger sized window, but no matter...
Media Center

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 06:53.
Twitter Facebook Google+