C #, when the site (ISite) is not null in the control life cycle?

I have a form

MyForm : System.Windows.Forms.Form {}

and i need to call

Site.GetService(..)

before the user starts using this form.

But this is null in the constructor and in all the load events that I tried to override. When the Site is not null, please?

+3
source share
1 answer

By default, IComponent.Site is installed only in the designer of Visual Studio. It is used for development-time services in the IDE, for example, to name a component. Here's an article that talks about how sites are used: Integration of development time — hosts, containers, and sites .

+4

Source: https://habr.com/ru/post/1716556/


All Articles