By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,569 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,569 IT Pros & Developers. It's quick & easy.

General issue with variables scope

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
"Magnus" <ma*************@mikla.nu> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 20 '05 #2

P: n/a
Thank U!

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

Regards Magnus
"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message news:O7**************@tk2msftngp13.phx.gbl...
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
"Magnus" <ma*************@mikla.nu> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
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
Nov 20 '05 #3

P: n/a
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
"Magnus" <ma*************@mikla.nu> wrote in message news:O2****************@TK2MSFTNGP10.phx.gbl...
Thank U!

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

Regards Magnus
"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message news:O7**************@tk2msftngp13.phx.gbl...
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
"Magnus" <ma*************@mikla.nu> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
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
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.