Solved

what would an Expert do?

Posted on 2011-09-30
2
285 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

762 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