Windows Develop Bookmark and Share   
 index > Windows Forms General > Form encapsulating into another class
 

Form encapsulating into another class

Hi!

I'am about to make my code a little bit modular. I had a form that handled user logins. A form has a lot of public members and method, so it was hard to find the ones Iwrote to use. Thus I looked for any opportunity to hide the members. I found a thread here, where it was written, that this kind of thinking is wrong, because I should use the most simple class that has the functionality I need. So I decided to write my own class, that handles the form for me. What I want is to initialize this class with some input parameters, and then the class handles everything.

I made the class, and also a form in the same namespace - it works. But i found that when typing in the editor the namespace both the form's class and my own class is accessible. For further simplicity and reusability I don't want the form's class to be accessible outside this namespace.

How can I make this? Or am I missing something in the way of thinking about OO?

Thanks for any answer or opinion!

Bence

ebence  Tuesday, February 06, 2007 11:37 AM

Did you try to change public Form1() to private Form1(), or even 'internal'?

Does this help?

Evan Mulawski1  Thursday, February 08, 2007 8:34 PM

Did you try to change public Form1() to private Form1(), or even 'internal'?

Does this help?

Evan Mulawski1  Thursday, February 08, 2007 8:34 PM

You can use google to search for other answers

Custom Search

More Threads

• Watch the clipboard
• Loading a TreeView Dynamicly with images from imagelist built on runtime
• Web Browser Control + Simulating clicking of a button.
• form showdialog not modal
• custom controls in C#
• Quick question about color properties selectors in vs2008 forms designer
• Getting Value From Dynamic Control
• What control to use to have ability to group items, and also to delete selected item?
• Set Controls + Windows Form
• Different Data with Diffferent