Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinForm coding question
Message
From
02/10/2002 23:22:02
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
WinForm coding question
Miscellaneous
Thread ID:
00707200
Message ID:
00707200
Views:
56
Hi, all...

I have a fairly complex business form, multiple tabs, featuring the following...

1) Grid containing results of a user-defined query
2) Labels that are configurable, based on database rules
3) Some textbox controls are enabled, some are not...some are visible, some are not, based on rules [like the user's role]

Your basic 'everything but the kitchen sink' form that's used by dozens of different clients with various rules.

This form has a 'rich' enough UI that it will never be in a brower, but I still want to isolate as much 'method code' from the Form.CS file as possible. However, I'm not 100% sure I know the best way to implement this.

The only method I thought of was to have the UI form (we'll call it DEDUCTION.CS) in the project, and another class called DEDUCTIONFORMRULES.CS in the project. The 'rules' class would take care of all the populating of lists, setting labels and textboxes, etc.

However, (and maybe this is just a syntax problem I'm having), I don't know how to 'access' controls from the UI form in the 'rules' class file. I'm not sure if I need to pass the entire form object as a parameter anytime I need to call the rules file. For instance, I have a label called 'lblDeductionID' on the form. The caption can be different, depending on the client. Even with the label defined as public, I don't seem to be able to access it outside the UI form [so that I can set the caption].

I'm sure there are many different ways this can be done. For now, I isolated all these methods as separate functions, and placed them at the bottom of my DEDUCTION.CS UI file. That way, whatever direction I wind up going should [hopefully] involve minimal headaches.

Help!

Thanks,
Kevin
Next
Reply
Map
View

Click here to load this message in the networking platform