locked
How to switch display from Visual C# debugging mode to target system's display? RRS feed

  • Question

  • It's usual that when VC# stops at break point, users can only see VC# screen and check source codes. The target screen can't be seen. How can it be conquered? 
    Monday, October 12, 2020 2:14 AM

Answers

  • Hi Stan Huang,

    It can be anywhere before the breakpoint is reached, I am used to putting it in the Form_Load event.

            private void Form1_Load(object sender, EventArgs e)
            {
                this.TopMost = true;
            }

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 15, 2020 2:13 AM
  • It worked but not as my expect. I originally wanted to break my program at some points and see both internal status of my program, such as some variable values, and execution status of my program. Now, I did as told and found I can see my program execution status and I can't be broken as expected originally.

    Any way, your input is very helpful.

    Thursday, October 15, 2020 6:07 AM

All replies

  • What is a target screen?

    By users what do you mean?


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, October 12, 2020 3:05 AM
  • That's me.
    Monday, October 12, 2020 3:12 AM
  • Hi Stan Huang,

    Thank you for posting here.

    Could you please describe your problem in more detail?

    Are you sharing the screen between two machines?

    It is best to add a picture, which will make the problem clearer.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 12, 2020 8:57 AM
  • Maybe press <Alt+Tab> or <Win+Tab> to switch to your application and back. If you have more monitors or a large monitor, then resize and move Visual Studio and your application to see both.

    Monday, October 12, 2020 9:56 AM
  • By target screen, I mean my application's windows. By VC# screen, I mean the screen of debugging windows. Please see attached files. As you can see, the debugging process went to a break point. I hope to see what content of my application output. But I don't know how to switch to my application's screen.
    Tuesday, October 13, 2020 6:36 AM
  • Both methods don't work.
    Tuesday, October 13, 2020 6:37 AM
  • See my response below.
    Tuesday, October 13, 2020 6:37 AM
  • Hi Stan Huang,

    I got your question, but there is no perfect solution.

    You can set "this.TopMost = true;"

    It will still freeze as before, but it will always be displayed on the top layer. You can place it in a suitable position in advance to see it during debugging.

    But if the debugging code involves modifying the content of the UI, you will still not see the real-time changes of the data. You can use BackGroundWorker or manually create a thread, and then use invoke to do it.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 14, 2020 8:41 AM
  • How can I set "this.TopMost = true;"? Could you describe the operation steps? 
    Thursday, October 15, 2020 1:45 AM
  • Hi Stan Huang,

    It can be anywhere before the breakpoint is reached, I am used to putting it in the Form_Load event.

            private void Form1_Load(object sender, EventArgs e)
            {
                this.TopMost = true;
            }

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 15, 2020 2:13 AM
  • It worked but not as my expect. I originally wanted to break my program at some points and see both internal status of my program, such as some variable values, and execution status of my program. Now, I did as told and found I can see my program execution status and I can't be broken as expected originally.

    Any way, your input is very helpful.

    Thursday, October 15, 2020 6:07 AM