473,394 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

General issue with variables scope

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
3 811
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hal Vaughan | last post by:
Being self taught, this is one thing I've always had trouble with -- I finally get it straight in one situation and I find I'm not sure about another. I have a class that keeps calling an...
30
by: Neil Zanella | last post by:
Hello, Suppose I have some method: Foo::foo() { static int x; int y; /* ... */ }
7
by: Nicole | last post by:
Hi I'm trying to use a function to set a session variable. I have three files: The first file has: <?php session_start(); // This connects to the existing session ?> <html> <head>
5
by: j | last post by:
Anyone here feel that "global variables" is misleading for variables whose scope is file scope? "global" seems to imply global visibility, while this isn't true for variables whose scope is file...
9
by: Stefan Turalski \(stic\) | last post by:
Hi, I done sth like this: for(int i=0; i<10; i++) {...} and after this local declaration of i variable I try to inicialize int i=0;
13
by: Robin Haswell | last post by:
Hey people I'm an experience PHP programmer who's been writing python for a couple of weeks now. I'm writing quite a large application which I've decided to break down in to lots of modules...
25
by: lovecreatesbeauty | last post by:
Could you talk something about the general rules on the interface (function) design in C program that recognized publically? Or introduce some good advice of yourself. How do you think about...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
22
by: Neil Gould | last post by:
Or... when is a script not a script? I have several modules for managing different aspects of our club's website, most of which are multi-page. Does setting such things as server.ScriptTimeout...
26
by: optimistx | last post by:
A variable in global scope var a1 = 'contents of global variable a1'; can be references (with some limitations) as window; // or window.a1; // or even window;
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.