473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form with many different layouts based on options

Hi all,

What is the best way to do this:

-I have a form, that has a couple of options (paths through the program),
A, B, and C.
-Each option has it own set of displays

In essence I have:

StartDisplay <-select which "path" to take
A1, A2, A3
B1, B2, B3, B4
C1, C2, C3, etc.
EndDisplay <-basically the same for all options

Is it a good idea to build each option as a User Control then swap the
controls out of a form dynamically? I'm doing this right now and it works
OK, but I'm wondering if there is a more elegant solution.

Or, should I just create 1 form for each option?

Thanks.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #1
7 1909
Hi Lucas,

You'd have them on the same form if there is a reason to. What reasons do
you have?

Some questions to consider:

What is common in the user interface?
What is common in the program logic?
Is the form just a shell for the user controls?
How would it help the user to have it all on one form?
Would the user care or even know if you did it with three forms?
How would it help you as a developer to put it all on one form?

Lastly, why do you think it may be better to do it another way? What is it
that strikes you as 'unclean' about your current approach?

Regards,
Fergus
Nov 20 '05 #2
Cor
Lucas,
There are not much "best" solutions with VB.net

You have so many possibilities to get what you want, that you can do things
on the way you like it.

In this case:
Some make different forms, because that is easy to keep up with changes.
Some make tab pages (beside the wish of the user) the same reason as above
but less flexible as above
Some hide controls which has the same problems as your method
Your method which is a little bit making it in the dark in my eyes, but when
it's done who cares.
And probably there are a lot of other possibilities.

My opinion is, take what you fits the best.
Cor

Nov 20 '05 #3
Cor
Hi Fergus,
Good Morning still active?
We did give almost the same answer in the same time I think.
Cor
Nov 20 '05 #4
Good morning Cor,

I'll be off to bed soon.

Probably ;-)

Fergus
Nov 20 '05 #5
"Fergus Cooney" <fi******@tesco.net> wrote in
news:Or**************@tk2msftngp13.phx.gbl:
Hi Lucas,

You'd have them on the same form if there is a reason to. What
reasons do
you have?

Some questions to consider:

What is common in the user interface?
I'm really building an wizard that can handle different file formats.
Hence the majority of the page is standard (i.e. Next, Back, Cancel
Buttons, a Datagrid, etc), but the actual options per page are different.
What is common in the program logic?
Nothing at all, so I encapsulated the login the user controls.
Is the form just a shell for the user controls?
Yup, exactly. This is OK right? I wanted to avoid having multiple forms
to keep updates as simple as possible.
Lastly, why do you think it may be better to do it another way?
I'm just wondering if there is another way. Currently I have a standard
form, which I swap the user control in and out dynamically. The control
contains the functionality pertient to the page.
What is it
that strikes you as 'unclean' about your current approach?


I'm just worried that when I have more paths to add, I'll need a lot of
logic to handle all the possiblities. I guess that's a given... hence I
wanted to know how other people have built a similar application
(Basically a Wizard that processes different file types in different
ways).

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #6
Hi Lucas,

From your answers it seems that you're on to a good thing. I've not done
any wizards myself, but container-with-flow-control plus separate juicy bits
would be my fancy.

The single wizards that I've used have either been single page by single
page with Prev/Next, or tabbed pages where you can click on the tabs as well
as use Prev/Next. I like these personally because they allow me to jump back
two pages to change something. They also show me how long the process is and
where I am.

Your situation is different. You can do either of the above (or anything
you like) with your wizards, but you want <multiples> of these. I think
keeping them separate as you have done is a fine method. I reckon that there
may be common logic to the separate wizard, even within the UserControls, so
I'd look to take as much of that into a base class.

From your first post's example, A1, A2, A3, B1, B2, etc. it seems that the
paths are discrete. I know that was highly simplified to get the point across,
but now that we know where we're at, what's the issue with the 'more paths'
bit ?

Regards,
Fergus
Nov 20 '05 #7
"Fergus Cooney" <fi******@tesco.net> wrote in
news:eh*************@tk2msftngp13.phx.gbl:
From your first post's example, A1, A2, A3, B1, B2, etc. it seems
that the
paths are discrete. I know that was highly simplified to get the point
across, but now that we know where we're at, what's the issue with the
'more paths' bit ?


Thanks for your responses. From what you wrote, it seems that what I'm
doing is "OK" so far by ecapsulating each page's element in a user
control.

What I meant by more paths is say in the future the wizard has to handle
different options (Oracle DB, MySQL, etc etc), then I'll need to add
customized paths for each. Hence, I'm worried that my flow control logic
would become much more complex.

Anyhow, here is basically how I control flow (in case you're curious):
Select Case OptionType

Case Option #1
DisplayOption1Page(Page#)
Case Option #2
DisplayOption2Page(Page#)
Case Option #3
DisplayOption3Page(Page#)
End Case

The procedure DisplayOption1Page(Page#) would then have logic to
load/remove the user controls based on which page the user is on.

I just thought there might be something more elegant... somewhat similar
to ASP Master Pages for ASP.NET.

Thanks alot for your comments... I really appreaciate the input. It help
put down some of the concerns I had.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Griff | last post by:
Hi there I'm after some suggestions as to how one might best separate form and content in a normal run-of-the-mill web application. I'm sure whole bookshelves have been written on this, but I...
5
by: Raffi | last post by:
Hi folks, I'm new to JavaScript and need some help. I have a form with a select field. Depending on what is selected in this field, I want to display or not display another select field. For...
2
by: allyn44 | last post by:
Hello, I have a form that I need to transfer some of the info into a second form based on a different query. The Id field is the same for data sources for both forms, but are based on...
7
by: rockdale | last post by:
Hi, How do you guys deal with the different clinet resolution? For example, you have 800*600, 1024*768 and 1280*1024 on client side. We used to put everything into a table with fixed width (the...
4
by: yanjie.ma | last post by:
Hi, I've got a two part question on table and form design (sorry for the length but it takes a bit to explain). Our sales department uses a look-up table to help the them select the best...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
4
by: sara | last post by:
Hi - I've looked at many posts, and cannot find the answer on this specific problem. I have several fields on a table, which I've defined as "Text", 3 characters, Format Yes/No (I picked up the...
113
by: Jon Slaughter | last post by:
Sorry for all the cross posting but I'm interesting in getting a serious discussion about how usenet has become lately. Many people are moving away from usenet because of all the spam and cooks...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.