I have a form
MyForm : System.Windows.Forms.Form {}
and I need to call
Site.GetService(..)
before user starts using this form.
But it’s null in constructor and all loading events I’ve tried to override.
When is the Site not null, please?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default,
IComponent.Siteis set only in the Visual Studio designer. It is used for design-time services within the IDE such as naming the component. Here is an article that talks about how sites are used: Design-Time Integration—Hosts, Containers, and Sites.