4 Replies - 5161 Views - Last Post: 26 August 2012 - 12:07 AM Rate Topic: -----

#1 jaredmalcolm  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 5
  • Joined: 18-August 12

C# Windows Forms Multi-Screen basics

Posted 25 August 2012 - 05:00 PM

I'm trying to find out how (a good tutorial would be great) to create a multi-screen windows forms application. I'm mainly trying to figure out how code is commonly split among classes/etc...basically what is the normal architecture.

At the moment the program will be quite small... a login screen and the I'll have a screen that will tie into our DMS and email out a copy of payroll as well as a screen to perform similar functionality for our employee that works on account collections.

If there aren't any good and CURRENT tutorials out there a good book would be useful as well.

Also I've worked through the demoPOS tutorial on here, but it seems to stop where I'd need it to continue!

Is This A Good Question/Topic? 0
  • +

Replies To: C# Windows Forms Multi-Screen basics

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5417
  • View blog
  • Posts: 11,609
  • Joined: 02-June 10

Re: C# Windows Forms Multi-Screen basics

Posted 25 August 2012 - 05:15 PM

Whether its 2 forms or 20, its mostly the same concepts:


How do I?

[*]Q: ...get Form 'A' to make a change or talk to Form 'B'
Spoiler

Was This Post Helpful? 1
  • +
  • -

#3 jaredmalcolm  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 5
  • Joined: 18-August 12

Re: C# Windows Forms Multi-Screen basics

Posted 25 August 2012 - 06:29 PM

After doing some searching online I'm just going to use our AD to do the login behind the scenes. Most of our users probably couldn't hand another login.

What is the recommended practice for using the tab layout? I was thinking of simply making a table on our SQL Server that we could set users up to see certain tabs using a
TabControl
and at the moment there won't be any need for the forms to talk back and forth.

Does these seem viable with expansion in mind for the future?
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3422
  • View blog
  • Posts: 10,538
  • Joined: 05-May 12

Re: C# Windows Forms Multi-Screen basics

Posted 25 August 2012 - 06:36 PM

Let me recommend not using the tab control. Not because it is not functional, but because it is very very easy to cheat encapsulation. tlhIn`toq just pointed you to a great tutorial that encourages encapsulation where data that needs to live in each form is kept there, and data that needs to be shared is exposed elsewhere. With a tab control, it is very very tempting to put all the shared data in the form class and then have each of the tab page handlers just be part of the form.

If you know the code is going to be a one-shot with very limited future life, go for it. If not, and you still really want to use the tab control, I recommend being very very disciplined about keeping data and code only where they belong.
Was This Post Helpful? 1
  • +
  • -

#5 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3422
  • View blog
  • Posts: 10,538
  • Joined: 05-May 12

Re: C# Windows Forms Multi-Screen basics

Posted 26 August 2012 - 12:07 AM

Oh yeah, and more thing about the tab control. By putting everything in a single table control, now everything has to be in a single form, and so if you want to take advantage of multimon, you'll expand the form to span multiple monitors. Probably not what you want. To make good use of multimon, you'll want to give the user options on how and where they put their windows/forms. With multiple windows/forms, the user can put active working windows on their main screen while the other reference windows can be put on the other monitor, or some other combination.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1