dimanche 10 mai 2015

Position of elements in form design window do not correspond to their position during runtime

EDIT: I realized that I didn't tag this properly - I should have included vb.net as a tag, so please excuse me in regards to that mistake.

I'm following the solution for creating a simple game in VB. During runtime, each PictureBox I've placed in the form design window maintains a relative position to each other PictureBox, but their positions are at a different scale compared to their positions in the form design window. I've faced this problem in VB Community RC 2015 and VB Express 2012 and believe the problem stems from running from using Windows 8 to run each IDE.

In order to show you the issue I'm facing, please look at the images below. Compare this image, where each PictureBox (i.e. a snake, set of arrows, etc.) has been placed so that they line up with a feature of the background image:

enter image description here

To this image, where the PictureBox elements are bunched together. Their positions have been "down-scaled" closer to the origin of the form (note that all the elements are transforming horizontally during runtime, which is why the elements are in the top right corner):

enter image description here

In the solution I was given (developed in VS 2010 I believe), the position of each PictureBox goes beyond the background image as shown:

enter image description here

It is clear that each picture box has been placed in an organized fashion. During execution, each PictureBox goes to it's intended position (i.e. lines up appropriately with the background image).

enter image description here

Obviously, the original developer of the solution I was given would have not faced the problem I am. The fact that the solution works properly during runtime indicates some kind of error with my instance(s) of VB. Does anyone know of any solutions? I've came across this question which asks how to change the default resolution for a Windows 8 App and this question which asks why some applications appear differently on different machines, but they pose no clear solutions. I would appreciate any help, since it's holding me back from critical work I must do. Thank you in advance!

Aucun commentaire:

Enregistrer un commentaire