Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create a form without max/min/close button in c#?

I know P/invoke can do, but is there a managed way?

like image 688
Benny Avatar asked Dec 22 '22 07:12

Benny


1 Answers

You should be able to toggle the ControlBox property.

public void CreateMyBorderlessWindow()
 {
    this.FormBorderStyle = FormBorderStyle.None;
    this.MaximizeBox = false;
    this.MinimizeBox = false;
    this.StartPosition = FormStartPosition.CenterScreen;
    // Remove the control box so the form will only display client area.
    this.ControlBox = false;
 }
like image 77
Galwegian Avatar answered Jan 05 '23 00:01

Galwegian