Question on InitializeComponent

  • Thread starter Thread starter Issac
  • Start date Start date
I

Issac

Hi,

I have some forms which inherit a base form with addition
controls.
But I got an error saying:
"MyProject.BaseForm.Private Sub InitializeComponent() is
not accessible in the context because it is private"

Because of this error, all other controls in inherited
form got "not declared" error.

I found that all errors will gone once I rebuild the
project. But it will pop again after I modify my code
which may totally unrelated to the problem forms.

Can someone pleaes give me a hand to resolve this problem?

Appreciate.

Regards,
Issac
 
Sounds like someone has been messing about with the designer code ?

Regards - OHM#
Hi,

I have some forms which inherit a base form with addition
controls.
But I got an error saying:
"MyProject.BaseForm.Private Sub InitializeComponent() is
not accessible in the context because it is private"

Because of this error, all other controls in inherited
form got "not declared" error.

I found that all errors will gone once I rebuild the
project. But it will pop again after I modify my code
which may totally unrelated to the problem forms.

Can someone pleaes give me a hand to resolve this problem?

Appreciate.

Regards,
Issac

Regards - OHM# (e-mail address removed)
 
First of all, thanks for reply.

That may be the case too, since we are doing a group
project, and someone may change designer code, which has
been told not to touch.

However, I find that we have to modify designer code in
some cases. For example, we have a custom control, and we
add a property, then remove it afterward. Such property
will still remain in designer code even we remove it from
custom control source. I am not sure if I do it right,
but I can't find another way to remove those code except
modify the form's designer code.

I am not sure if that's the reason for my problem, but I
am not comfortable to modify the code that has been told
not to modify too. If you have any other way to handle
such case, please do give me a little hint.

Appreciate.

Regards,
Issac
 
Back
Top