Separate Code Files?

Topics related to the Krypton Navigator.

Moderators: Phil Wright, Chris Porter

Separate Code Files?

Postby ColinM » Thu Feb 07, 2008 6:00 pm

Anyway to put the code in separate file for each KrpytonPage?
I've got 2 nested Navigator with several pages but all the code is in one file, getting a bit messy.
ColinM
 
Posts: 5
Joined: Fri Jul 20, 2007 12:41 am

Postby Phil Wright » Thu Feb 07, 2008 7:12 pm

Not really. I suppose you could create a different user control that represents the contents of a page. Then your main form is just a single navigator with a set of pages, where each page has a custom control docked to fill it.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia

Postby Tommy Carlier » Thu Feb 07, 2008 9:52 pm

Phil's right. Separate UserControls are a clean way to do it. I'm working on an application where the main form has 2 navigators, each with 6 pages. For each page I've created a UserControl. If you use too many controls on 1 form (without using UserControls), the Windows Forms designer is a lot slower and could easily crash. Another advantage of using UserControls: it's a lot easier to set the Tab Order of the controls on the individual UserControls.
Tommy Carlier
 
Posts: 102
Joined: Sat May 06, 2006 9:51 pm
Location: Belgium

Postby ColinM » Sat Feb 09, 2008 3:12 pm

Yeah, looks like usercontrol's is the way to go. I can use different namespaces also. Stops my buttons being called something like "btnNew_Form3"
ColinM
 
Posts: 5
Joined: Fri Jul 20, 2007 12:41 am


Return to Krypton Navigator

Who is online

Users browsing this forum: No registered users and 1 guest

cron