Today I was trying to look how to get zoom (in/on) a userForm with the mousewheel. The more I searched the less I found. So came to open a thread, and yesterday there was the post 1297548 on excelForum (excelforum.com/excel-programming-vba-macros/1297548-pan-on-a-zoomed-in-image-on-a-userform.html). Not the same, but similar, still not the solution to my issue. (zooming "on" is the same thing as you need to modify height/width/top/left values, zooming "in" is a little different, but similar code should).
I could not use Andy Pope's approximation as I need the MouseUp and Down method for other purposes, but the mousewheel is there for no use. As I said, I have not found anything to solve the zoom issue so far.
Not all the search time was wasted. I have not finished it, is just an idea in which I will be working late today, but I think this is on the good path:
With the hook code on mrexcel forum board (mrexcel.com/board/threads/generic-mousewheel-scroll-for-userform-and-for-all-its-controls.961943/page-4), with the attachment app.box.com/s/189ehjeyrtbnb1uk1sq8xul5jz1xpicm, or this other solution in github from cristianbuse (github.com/cristianbuse/VBA-UserForm-MouseScroll) (sorry I have not enough "Karma" to post links) you can make a hook to any control (can focus on the scroll control type).
If you place a (Not) Visible scroll control in the userform, you can link the hook to that control. Afterwards, you will only need to modify the ScrollBar1_Change method to control the userform.zoom property.
Any other idea before I try is wellcome. I suppose that there should be a way to link the hook to the UserForm.Zoom property without the need of the scroll control, but I could not manage to do it (I don't know if possible)
Kind regards
Bookmarks