Baya_ju suggested that you would use GetWindowRect, which you should, and a Timer, which you shouldn't. GetWindowRect will provide you with the coordinates of the Form but using a Timer and constantly check these coordinates is just a waste of CPU. A better approach would be to subclass your Form and check for messages which (unfortunatly) VB doesn't provide as events. Such as when your Form is being moved and of course resized, this event is provided by VB but to keep it clean I've added that message as well to the project that I attached.
A little warning though. Since you say you're new to APIs I'm guessing you're even newer to subclassing. When you use this approach you can NOT use the End keyword in your project to end the application (which you shouldn't do anyway) and you can't use the End button or menu item from inside VB (since that will just call the End function). Close your windows (from code) using the Unload statement and close and end the application by closing the Forms using the X button.
The attached project shows how to hook one window next to another. Even if you don't understand the code you can easily do this in your own project by adding the StickyHook.bas module to your project. You would then just call the HookForm procedure from your Form_Load event (or at any other place) passing the parent window and the child (the sticky window) as parameters:
VB Code:
HookForm Me, frmSticky
The form called frmSticky in the above call will then "stick" to the right edge of the parent form (Me) as long as it's loaded.
You should also call the UnhookForm in the Form_Unload event of the "parent" form, but in case you forget to do that the module will take care of that as well.
Sorry, missed that part. The following attached example will do that. I've added a third argument to the HookForm sub which accepts the PictureBox. This PictureBox must however reside on the parent form (and the code actually doesn't check if that is the case so just make sure it is).