Benny
Benny

Reputation: 8815

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

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

Upvotes: 4

Views: 6890

Answers (2)

Umair Ahmed
Umair Ahmed

Reputation: 11694

Yes... Just disable the control box on the form properties.

Upvotes: 1

Galwegian
Galwegian

Reputation: 42247

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;
 }

Upvotes: 10

Related Questions