Solved

Visual c# form design - Best practices

Posted on 2006-11-01
4
338 Views
Last Modified: 2013-12-04
I have a windows forms application (microsoft visual c# 2005) that accesses mysql database to display, enter or modify data. The main form has the menu on the left side where the user selects from a list of choices. When a user makes a selection, info (text boxes, etc) is displayed on the right side. The question is: what is the proper container to use for the right side? I am currently using custom controls for each of the menu options. Is there a better way to implement this? What are you all using in such situations? Any Advice?

Thanks
0
Comment
Question by:panayoti
[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
4 Comments
 
LVL 6

Accepted Solution

by:
DonKyles earned 75 total points
ID: 17863319
I use asp:Panel...why?  because I can set the focus to the field I want when the user click from the menu. I also can set the default button for each panel.
example.

menu 1  ----- onclick visible pnlMenu1 invisible pnlMenu2 and pnlMenu3
menu 2  ----- onclick visible pnlMenu2 invisible pnlMenu1 and pnlMenu3
menu 3  ----- onclick visible pnlMenu3 invisible pnlMenu1 and pnlMenu2

<asp:Panel ID="pnlMenu1" DefaultButton="btnAdd" visible="false">....</asp:Panel>
<asp:Panel ID="pnlMenu2" DefaultButton="btnUpdate" visible="false">....</asp:Panel>
<asp:Panel ID="pnlMenu3" DefaultButton="btnDelete" visible="false">....</asp:Panel>

By this way, you can do anything in a single page.
0
 
LVL 15

Assisted Solution

by:angus_young_acdc
angus_young_acdc earned 50 total points
ID: 17865330
It's rather difficult to say, most people have different practices for everything.  For example when using a button I would name it btnName, and others prefer things like btn_Name / Name_btn etc.  

For your needs I would most likely go for Splitter or SplitContainer.  Depending on how much information, and how big you want the menu etc to be.  A SplitContainer would be good as objects are only shown in that specific Panel, they are not spread across the two areas.
0
 
LVL 6

Assisted Solution

by:DonKyles
DonKyles earned 75 total points
ID: 17872052
Or if you are using ASP.NET 2.0, you can use MasterPage to hold the menu. When you create a new webform you just select the MasterPage without copy the code from another file. And all the page will be the same layout/style/format.... MasterPage is like Header and Footer that you insert at the beginning and the ending of the html code. This might be a best practice for Menu and the layout of the page.  The menu will be the hyper link to link to the appropriate page. For example,

---------------------------------------------------------------------------------------------------------------------
                                             Header/Title
---------------------------------------------------------------------------------------------------------------------
Home        |  Home :: Add Form
add           |     i-------------------------------------------------------------------------------------------------|
edit           |     |                                                                                                                         |
delete        |    |                                            Add Form                                                                |
view          |    |______________________________________________________________________|
                |
                |
----------------------------------------------------------------------------------------------------------------------
                                           footer
----------------------------------------------------------------------------------------------------------------------
0
 

Author Comment

by:panayoti
ID: 17926731
Thank you all for your suggestions:

I did not mention that my application is not asp based.

Is asp Panel indicative for a windows desktop application? Setting the panels to invisible, system resources won't be released which will result in poor performance as the number of panels increases. How do I design my panels at design time? Recall that each panel will have a number of other controls (dataGridView, textboxes, buttons, tab controls, binding navigators, etc).

Regarding the other option, use of split container, I am using split container. The question is what container I need to use for the right panel of the split container(panel 2) to place my controls on? There will be more than one such containers (as many as the menu options) and how these containers will show and hide based on the menu selection? I am currently using custom controls that are created and loaded dynamically based on the menu selection.

Any more ideas?
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

729 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