1

I am actually developing a UserControl that requires this kind of form.

Normally a WinForms Form looks like this:

enter image description here

If I set "FormBorderStyle = None", it looks like this:

enter image description here

But, I actually need a window without TitleBar like the following:

enter image description here

Please see the difference at the edge of the window. It actually looks more like a context menu.

myForm.Text="";
myForm.ControlBox= false;

This solution leaves the TitleBar so that the form remains movable. This is a problem.

I actually need this: the user click the button and the form appears like the following:

enter image description here

How to do this?

user366312
  • 16,949
  • 65
  • 235
  • 452

2 Answers2

2

you can use:

yourForm.Text="";

yourForm.ControlBox= false;

and in properties, change : FormBorderStyle to :FixedDialog

razzek
  • 595
  • 7
  • 23
Zied R.
  • 4,964
  • 2
  • 36
  • 67
1

To get like that then do not set any title text and make controlbox visible false

like this

yourForm.Text="";
yourForm.ControlBox= false;
Sudhakar B
  • 1,465
  • 9
  • 16