I have a very specific job - I have to overlay a transparent label over a photo of some text of the same font and size. This requires a simple control scheme for the label to move 1 pixel in each direction using a set of 4 buttons, as the location of the scanned text under the label might change batch to batch. These are the buttons I have:
I am aware that a control's position is based on its parent. In this case that might have changed as I have this for the overlayed label:
var pos = this.PointToScreen(lblOverlay.Location);
pos = pbMain.PointToClient(pos);
lblOverlay.Parent = pbMain;
lblOverlay.Location = pos;
lblOverlay.BackColor = Color.Transparent;
This changes the parent of the label to the picturebox under it. What I cannot explain is why in the winforms builder, the label's location is 65; 70, but when I want to change it's location using a different method than the buttons I mentioned, I have to use half of those values:
lblOverlay.Location = new Point(31, 35);
So in the end my question is this: How would I go about coding the buttons so that they nudge the label's position by 1 in the corresponding direction? There only needs to be an example of one of the buttons, I should be able to figure out the other three.