0

I have developed a COM based Windows Form application and deployed it on Windows server 2008 R2.

The process is that a user will open a different third party application installed on the same server from his browser and then for a particular operation the third party application will start instance of my application.

Everything works perfect except when instance of my application opens in the user's machine, it's not fully TopMost window. The taskbar of the user's machine gets semi displayed on the running application. Below is the code I am using and I have attached the image as well. can anyone please help me in resolving this issue.

private void frmCyberLab_Load(object sender, EventArgs e)
{
      Module.cancelled = false;
      this.FormBorderStyle = FormBorderStyle.Sizable;
      this.TopLevel = true;
      this.TopMost = true;
      this.Location = new Point(0, 0);
      this.Height = Screen.PrimaryScreen.Bounds.Size.Height;
      this.Width = Screen.PrimaryScreen.Bounds.Size.Width;

      // Some more code here not related to form's display property.
}

enter image description here

Edit- I even tried using FormBorderStyle = FormBorderStyle.None; as suggested in the comment but I am still facing this issue. can someone please tell me what could be the reason and how Can I solve it.

Anil kumar
  • 525
  • 2
  • 10
  • 32
  • Does that taskbar go over buttons too? – huseyin tugrul buyukisik Sep 23 '16 at 16:29
  • [This (possibly duplicate) question](http://stackoverflow.com/questions/505167/how-do-i-make-a-winforms-app-go-full-screen) suggests you need `FormBorderStyle = FormBorderStyle.None;` – stuartd Sep 23 '16 at 16:30
  • Those property changes should probably be happening in the form's constructor. TopMost really is only meant for your own application, since if two apps decided to be top most, there would be a fight. Is there a reason you aren't using WindowState.Maximized? A border style of none is usually required for a kiosk type app. – LarsTech Sep 23 '16 at 16:31
  • But in that case, there won't be any cross, minimize or maximize button. – Anil kumar Sep 23 '16 at 16:31
  • There is no problem in using WindowState.Maximized, but I do want the borders and the minimize, maximize and cross buttons. – Anil kumar Sep 23 '16 at 16:36
  • When I am opening the application from Visual studio. There is no such problem. – Anil kumar Sep 23 '16 at 17:18

1 Answers1

0

To solve this issue I followed this Artcle - http://www.codeproject.com/Articles/16618/How-To-Make-a-Windows-Form-App-Truly-Full-Screen-a and also had to drop the idea of using the borders in the form.

Anil kumar
  • 525
  • 2
  • 10
  • 32