Now when I add a Notebook with different pages, the components of my tool stay fixed. When you shrink the tool and move the side of the window, the components don't get bigger/smaller and they are also not accessible if you don't move the side back. I hope it get's clear what I mean
That is because
Form1.Controls doesn't include them. There is only the
Notebook1 on which the
Form1 is the immediate owner.
Notebook1.Controls eventually includes
Page1 and
Page2. In turn, each of the pages includes some of the other controls.
You can't walk them in a single loop, you should go in depth.
How would you change the code in order for the components to be stretched/shrunken on a Notebook-Page ?
May be you should consider the Anchors property and Anchor Editor into the Object Inspector if you want to keep the edge offsets constant.
IMHO, (if we put aside the question of the rightness of this method) this code is incorrect for scaling, at least it keeps a lot of unnecessary information. You can keep only the X,Y ratios of the form itself.