My textboxes and labels are fine in design view, but when I switch over to Debug or Build, a couple of the textboxes are pushed together and the labels aren't in their original spots. Haven't seen this before and was wondering if anyone has any suggestions as to why and how to fix?

Recommended Answers

All 12 Replies

Do you have any code in the form's resize event or any code anywhere that changes their location?

Also, is the screen resolution any different when debugging/release?

No, there's no code in the form resize even and none that changes the location. And yes, the resolution is the same. The form was working great until I had to add one more textbox and label. No problems during design view, but as soon as I entered debug mode or checked the build, the boxes were pushed together and labels were moved away from on top of the textboxes. All textboxes and labels are anchored the same as well (top, left).

What form border style are you using?

I know I have had some issues when desinging in Sizable and then changing it to Fixed3D ect..

Are these controls placed inside another? ie. Panel, Groupbox ect..

I'm currently am using the Fixed 3d style and it hasn't changed. And no they are all inside the same panel. If it helps, I could add a screenshot to show what I am talking about.

Sure, if you don't mind.

Is AutoSize set to False for all Labels or any changes in FontSize ?

I've set the Autosize to both False and True for the labels and there has been no changes in fontsize. I've narrowed the problem down to JUST the labels as they keep getting shifted further to the right while in debug/build mode, compared to where they are in design view. I've also deleted the designer code, saved the program and restarted it while pasting the designer code back in to try and reset the contsruction with no luck.

Is there a way to view the location of these items while debug mode is displayed to see if it varies from design view?

Show us your Designer code of the form (whole code).
Its hard to tell what can be wrong, but for sure there is some "additional" code that changes position of controls.

Mitja - I sent you a pm with the designer code

Found the X,Y coordinates in the .resx part of the designer code, which is where the wrong coordinates were being displayed.

Iam glad you found it. I told you there has to be some code that does changes.
From now on you will know where to look if this kind of issue appears.
bye

commented: Good job Mitja! +5
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.