1

What exactly is difference between them?

form2.Opacity = 0

and

form2.Visible = false
Sandeep
  • 1,504
  • 7
  • 22
  • 32
Orient
  • 11
  • 2
  • 1
    I'm not going to post this as an answer, 'cause I'm not pretty sure about it. To me the difference is the fact that an object with visible=false will NOT be drawn, while another with opacity=0 will be drawn. So, processing time is a difference here. – Ed de Almeida Mar 04 '16 at 10:20
  • You can click on `opacity=0` control, but can't click on invisible one – Dmitry Bychenko Mar 04 '16 at 10:25
  • Big, big difference. The OS still considers the window to be visible. Its Visible property is true, its OnPaint method still runs, it still has focus and it still has a taskbar button. Its pixels are simply not rendered to the screen anymore and mouse clicks have no effect. The taskbar button is, perhaps, the most important quirk. Not terribly useful, other than to hide visible paint artifacts and making a screenshot that does not include that window. – Hans Passant Mar 04 '16 at 10:40

2 Answers2

1

The Opacity property enables you to specify a level of transparency for the form and its controls. When this property is set to a value less than 100 percent (1.00), the entire form, including borders, is made more transparent. Setting this property to a value of 0 percent (0.00) makes the form completely invisible.

from msdn opacity

The Visible property enable you to specify wether the form should be visible or not. it is like on or of for visiblity off the form.

from msdn visible

venkat
  • 269
  • 1
  • 11
1

Opactity = 0

You can't see it, but it is there and you can still click on it, get mouse events etc.

Visible = false

You can't see it and it is not rendered nor can you click on it or get mouse events etc.

Jens Meinecke
  • 2,904
  • 17
  • 20