Solved

what would an Expert do?

Posted on 2011-09-30
2
288 Views
Last Modified: 2012-05-12
i'm writing a customer support app (vs 2010\vb.net\mysql) for my company. it's very straightforward, get customer details and populate a bunch of controls - txt fields, listboxes, etc. there's also a bunch of transactional functionality through buttons. never having written, or worked with, a customer support app before, i made the mistake of having the app work only with a single customer at a time. but now there's a need to work with more than one customer - identical data (but for diff customers), identical functionality.

my question is this: what is the best way to manage this kind of identical duplication of data\functionality? basically, i simply created a tab control and put all the original controls on tab page one, and then made a copy of them on tab page two and renamed them from txtCustomerName --> txtCustomerName2, txtCustomerID --> txtCustomerID2, etc. then, i just set a flag recording what tab page i'm on, and all the code behind behaves according to the flag. The problem with this is that i've basically doubled the amount of code i have,

if i'm on tab page 1 then

      do this

elseif i'm on tab page 2 then

      do this

end if

is there a better way to manage these types of more-or-less identical collections of controls\functionality? for example, i'd like to put even a couple more tab pages on my tab control and let them have 3 or 4 different customers open at the same time, but i'm sure i'm not handling this problem in the best way.

any advice is greatly appreciated...

TIA,

crafuse
0
Comment
Question by:crafuse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 36892669
I would rather go for a MDI (Multiple Documents Interface) type of interface. This is the same system used by Word and Excel so that you can open multiple document at the same time.

That would enable the user to see both customers at the same time on the screen. And as an extra, without doing any thing special, the user will be able to display as many customers as he wants. Another extra. Since you will be reusing multiple copies a the same form and each form is individual, you won't have to make the difference between TextBoxName1 on the first tab and TextBoxName2 on the second tab. Each form with handle itself from a shared code base.

Create a Form with the display you intended to put in a tab. This will create what we will refer to as a child form, so let's call it FormChild.

Create another form. That will be the MDI, so call let's call it FormMDI. In that form, set the IsMdiContainer property to True.

Add a button or a menu to FormMDI with the following code:
Dim frm As New FormChild
frm.MdiParent = Me
frm.Show()

Open in new window

Startup the application in FormMDI.

Each time the use activates the button or the menu, a new copy of FormChild will open inside of the MDIForm.

Have fun.
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 36892698
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question