General issue with variables scope

  • Thread starter Thread starter Magnus
  • Start date Start date
M

Magnus

Hello!

I have started a new project with one large form.
The problem is the size, so I want to use User Controls instead for my objects and the code.
Unfortunately I can't find an easy way to use the same code in user controls to change properties for different controls in either the form or in other user controls. Tried to declare controls with public but it doesn't seems to work.
Actually, all I want is to separate the code so all code isn't in one place, though it's so hard to read.
How could I do this in a simple way?

Regards Magnus
 
maybe by using Interfaces that all controls and the form implement?

I am not entirely sure what you want to do.

You can have friend methods or public methods in the controls. (friend better if you just want internal sharing)

Shane
Hello!

I have started a new project with one large form.
The problem is the size, so I want to use User Controls instead for my objects and the code.
Unfortunately I can't find an easy way to use the same code in user controls to change properties for different controls in either the form or in other user controls. Tried to declare controls with public but it doesn't seems to work.
Actually, all I want is to separate the code so all code isn't in one place, though it's so hard to read.
How could I do this in a simple way?

Regards Magnus
 
Thank U!

WIth your help I think I've got it to work.

Regards Magnus
maybe by using Interfaces that all controls and the form implement?

I am not entirely sure what you want to do.

You can have friend methods or public methods in the controls. (friend better if you just want internal sharing)

Shane
Hello!

I have started a new project with one large form.
The problem is the size, so I want to use User Controls instead for my objects and the code.
Unfortunately I can't find an easy way to use the same code in user controls to change properties for different controls in either the form or in other user controls. Tried to declare controls with public but it doesn't seems to work.
Actually, all I want is to separate the code so all code isn't in one place, though it's so hard to read.
How could I do this in a simple way?

Regards Magnus
 
great! I'm glad to help.
I am a vb.net newbie myself, though I have years of former VB, C and other ms tech. experience.

Dan Appleman had it close to right when he said something like, Everything you knew before is now completely obsolete.

I am having to learn how to do everything that I had mastered in other versions too.

God bless,

Shane
Thank U!

WIth your help I think I've got it to work.

Regards Magnus
maybe by using Interfaces that all controls and the form implement?

I am not entirely sure what you want to do.

You can have friend methods or public methods in the controls. (friend better if you just want internal sharing)

Shane
Hello!

I have started a new project with one large form.
The problem is the size, so I want to use User Controls instead for my objects and the code.
Unfortunately I can't find an easy way to use the same code in user controls to change properties for different controls in either the form or in other user controls. Tried to declare controls with public but it doesn't seems to work.
Actually, all I want is to separate the code so all code isn't in one place, though it's so hard to read.
How could I do this in a simple way?

Regards Magnus
 
Back
Top