Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form maximizes when seen via Remote Desktop

I have written an HMI (Human Machine Interface) program for some kind of machine. The program runs on a touch panel with "Windows Standard Embedded 7". I guess it makes no difference to my problem that it is an embedded version of Windows 7.

  • The WindowState of the main form of my program is set to Normal, and the size set to match the resolution of the touch panel (1280x800).
  • The FormBorderStyle is set to None.
  • The StartPosition is set to CenterScreen.

The issue is:

  • when starting the program directly on the touch screen the program is shown as it should, filling the screen completely from top/left to right/bottom. This is OK!

  • when the program is NOT running and you log on to the touch panel via Remote Desktop (with a bigger screen, let's say 1920x1200), and THEN start the program (through the rdp session) the program also starts as expected, shown in the middle of the screen with the size of 1280x800. This is OK!

  • when logging on via rdp WHILE THE PROGRAM IS ALREADY RUNNING the program is shown as maximized, filling up the whole screen (1920x1200). This is not good, as the whole layout of my program is made for 1280x800!

Does anyone have an idea why my program is behaving like this, or is the problem somehow related to the rdp session?

like image 238
JohnSaps Avatar asked Jan 22 '13 08:01

JohnSaps


People also ask

Why does remote desktop not show the full screen?

-Click on "Options". -Click on the "Display" tab. -On "Display configuation" settings, you can change the "Remote Desktop Connection" display by moving the slider from "Small to Large". -By moving the "Slider" all the way to large, the display settings will automatically set to "Full Screen".

How do I Display a Windows form in the full screen from the top of the taskbar?

FormBorderStyle = FormBorderStyle. None; WindowState = FormWindowState. Maximized; And then your form is placed over the taskbar.

How do I reduce the size of my remote desktop?

Using the built-in Remote Desktop App in Windows 10 Click on Show Options. Then click on the Display tab. Adjust the Display resolution to 1920 x 1080 or smaller, as it works for you.


1 Answers

This is probably caused by system trying to keep windows layout relative to the borders of screen. I've noticed this few times with some applications. If the app is not maximized but takes 100% of screen width after RDPing with bigger resolution it keeps it 100%.

If you want to prevent this you try can setting MinimumSize and MaximumSize propreties od the form to 1280x800 in the Form constructor. It should work

like image 101
Peuczynski Avatar answered Oct 02 '22 12:10

Peuczynski