none
control position at runtime

    Question

  • The location of a group of three textbox arrays when running with the executable (.exe file) is not the same as their position when running within the IDE. These arrays line up properly with their respective labels when running within the IDE but they are not lined up when running with the executable.

    All of the other controls are correctly positioned during both the IDE execution and the .exe execution.

    Sunday, January 24, 2016 11:54 PM

All replies

  • The location of a group of three textbox arrays when running with the executable (.exe file) is not the same as their position when running within the IDE. These arrays line up properly with their respective labels when running within the IDE but they are not lined up when running with the executable.

    All of the other controls are correctly positioned during both the IDE execution and the .exe execution.

    Hi,

    are all controls anchored the same way?

    Regards,

      Thorsten

    Monday, January 25, 2016 3:00 AM
  • Thorsten

    Yes they are all anchored Top,Left.

     I am assuming that running in the IDE uses the same executable code as when running from the.exe file. If that is true how can the results differ? 

    I should point out that the three misbehaving arrays are created at run time, but this should take place when running from either the IDE or the .exe.

    Skip Sampson

    Monday, January 25, 2016 11:55 PM
  • Thanks for Thorsten's reply.

    Hi Skip Sampson,

    Please create a sample project which also add the controls at run time, whether it also has the same problem?

    If no, this problem is related to your specific project. Please tell me what type of project and share some code snippet to help us reproduce this problem.

    If yes, please tell me which version of Visual Studio and OS you are using and also share some code snippet to help us reproduce this issue.

    Best Regards,
    Weiwei

    Tuesday, January 26, 2016 6:01 AM
    Moderator
  • Thorsten

    As you suggested, I created a small sample project that creates three arrays at runtime. I do not get the misalignment problem. I will now try to find the critical difference between the two projects, before I call upon you for further help.

    Comparing a small project result with the full blown project result was a very good idea. I have been programming for sixty three years, beginning with an IBM punched card computer in 1954. You'd think I would have learned that diagnostic trick by now. Never too late to teach an old dog new tricks.

    Thanks very much for your assistance.

    Skip Sampson

      

    Tuesday, January 26, 2016 7:35 PM
  • Hi Skip Sampson,

    >>I do not get the misalignment problem.

    So the problem is related to your project. I suggest you move the origin project file to the new project one by one, it can help us make sure which file causes this problem. Then you can move the content in this file to the new file to confirm which control causes this issue.

    I will wait for your compare result for this issue. Please feel free to let me know what you have found and share your discovery here. It is benefit to other communities who has the same problem.

    Best Regards,
    Weiwei


    Wednesday, January 27, 2016 1:36 AM
    Moderator
  • Weiwei

    I don't understand what you mean by "move the origin project file to the new project ". Am I to move files around using the Windows Explorer, or am I to move files within the IDE? I don't think of my project as having files within the IDE. I have a standard. module and two class modules all of which contain code for the various controls.

    If I am to do this using window Explorer, which files do I move? Could you elaborate?

    I am happy to help other member of Community, but you will have to be patient with my inexperience in this matter.

    Richard

    Thursday, January 28, 2016 1:05 AM
  • Hi Skip Sampson,

    It's my pleasure to help you troubleshooting this problem.

    I assume your solution A, which contains a Windows Forms project and two class library projects. Please create a new solution B which has the same name and structure with the solution A, and it also has a Windows Forms project and two class library projects.

    Then please right-click Windows Forms project in solution B and open folder in file explorer. Then copy the forms one by one to this Windows Forms project folder in solution B. You also can add them into solution B with Add Existing Items one by one.

    After moving one Windows Forms every time, please check whether it has the control position problem for every form. If one of them has this problem, then please open this (solution A) form in another Visual Studio instance and the copy the controls one by one to the (solution B) form to check which one causes this problem.

    Best Regards,
    Weiwei

    Thursday, January 28, 2016 3:27 AM
    Moderator
  • Weiwei

    I think there may be some misunderstanding about my project configuration. In your latest communication you referred to a solution A "which contains a Windows Forms project and two class library projects". Actually, I have one project, call it Project A. It consists of one standard module, call it Module1, and two class modules (form modules), call them Form1 and Form2. One of the functions of the standard module is to provide global data for the two class modules.

    If I interpret your current instructions properly, I would move Module1 to Project B and then test. Then I would move Form1 to Project B and test and then move Form2 to Project B and test. I am probably misinterpreting your instructions, since I can't see how the project would run without all three modules installed.

    Any further thoughts?

     

    Skip Sampson

    Friday, January 29, 2016 4:26 PM
  • Hi Skip Sampson,

    My above troubleshooting steps are applied to common projects which can run without other dependencies.

    Since your situation has been make sure just the group of three textbox arrays exist this problem, please add a new screen and then copy the controls from the broken screen to the new screen one by one.

    If possible, please share a sample project to us, which is benefit to us reproduce your problem and then find out the problem.

    Best Regards,
    Weiwei

    Monday, February 01, 2016 2:00 AM
    Moderator
  • Weiwei

    Sorry to be so late getting back to you.

    I looked at my Display setting in Control Panel. It was set at 150%. I set it to 125%. That solved all my problems. Screen.Bounds, while running, is now at 1920x1080, which is the same as the resolution setting. Now the location of the arrays when running with the .exe file is the same as when running in the IDE.

    Thanks for your help.

    Richard 

    You cannot vote on your own post 
    Saturday, March 05, 2016 6:06 PM
  • Hi Skip Sampson,

    Thanks for your response and sharing your solution here. Please mark the helpful reply as answer which is benefit to other communities who has the same problem.

    If any questions about Visual Studio IDE, please feel free to come back to our forum to create new threads.

    Best Regards,
    Weiwei

    Monday, March 07, 2016 3:15 AM
    Moderator