473,376 Members | 1,012 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,376 software developers and data experts.

Multiple screens on the same form

Hi. Is there someone that can tell me how can I have multiple screens
on the the same form, displaying only on at the time?

Thank you all for any replys.

Joćo Carias

Jan 10 '06 #1
9 4599
Hello Quina,
Multiple Screens? Tell us, more about this..
Regardings...
Bahadir ARSLAN
www.maxiasp.net
Hi. Is there someone that can tell me how can I have multiple screens
on the the same form, displaying only on at the time?

Thank you all for any replys.

Joćo Carias

Jan 10 '06 #2
Have you thought of using tab pages.
"Quina" <ca*********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hi. Is there someone that can tell me how can I have multiple screens
on the the same form, displaying only on at the time?

Thank you all for any replys.

Joćo Carias
Jan 10 '06 #3
Quina wrote:
Hi. Is there someone that can tell me how can I have multiple screens
on the the same form, displaying only on at the time?

Thank you all for any replys.

Joćo Carias


I had a requirement to have countless forms to be displayed. Instead of
using a TabControl (which I would have for a lesser number of forms) I
used a treeview control on the left hand side of a main form to navigate
the collection of forms, then loaded the required form in the right hand
section of the main form based on the TreeNode selected. I set the main
form IsMdiContainer to true and set the childs forms MdiParent to the
Main Form. Maybe not the best way but it seems to work.

Thanks,
Ross McLean
Jan 10 '06 #4
This depends upon the effect you want.

Do you want all of the screens to be accessible to the user on demand,
in any order? Then, as Mark Carew pointed out, you should use a
TabControl.

Or, perhaps you want a "wizard" style interface, where the program
guides the user through the pages in a certain order, offering "Next"
and "Back" buttons. In this case, I would recommend making each "page"
a UserControl (a separate .cs file) and then placing all of the
resulting UserControls together on the final Form. Then you can handle
Next like this:

this._panel2.Hide();
this._panel3.Dock = DockStyle.Fill;
this._panel3.Show();

In order to handle the Back functionality, I recommend creating a Stack
on which you push UserControls as you Show() them, then if the user
presses a Back button then just pop the topmost UserControl from the
stack and Hide() it, and Show() the UserControl that is now topmost on
the stack.

Anyway, that's how I implemented a "wizard" style user interface.

Jan 10 '06 #5
Ok here is the deal: I whant to use a single form with many diferent
interfaces according to a menu, perhaps on the left of the form, for
example like MS Outlook .
My first thouth was using a TabControl (as Mark Carew refered) but, it
is impossible to hide the tabs.
Then I tryed to use an mdiForm (Ross McLean's sugestion)... well, it
works, but I cannot press Ctrl+F6 or the forms will chance.
The Panels solution doeslook good, but it is way too out my leage!! I'm
C# and VStudio beginner... Never the less, I would apreciate some more
info on this, specially on the separete .cs files.

Thank you all for your replys,
sincerely,

Joćo Carias

Jan 11 '06 #6
The panels thing shouldn't be too hard.

Just use Visual Studio to create a new UserControl and give it a name
indicating what one of the panels (screens) is for.

Make the UserControl as big as you need it to be, and lay out controls
the UserControl so that it looks the way you want (say) the first panel
to look. The UserControl that you created will appear as a separate .cs
(and corresponding .resx) file in your project.

Then, create a new Form class for your main application. Go the toolbox
at the left of Visual Studio and click on (I think it's) the "User
Components" section of the toolbox. You should see your UserControl
named there. Just drag it onto the design surface like you would any
other control.

Now you can use .Show() and .Hide() in your code to make the correct
panels appear / disappear when the user indicates a choice.

The only tricky part is if you want a "Back" button to go back to the
previous panel that the user was looking at, but don't worry about that
for now.

Yes, you can do this without UserControls, just by putting lots of
Panels on your design surface and laying each Panel out, but trust me:
this will quickly become a nightmare. It's a lot easier to make each
separate panel (or screen) a separate UserControl, and then manipulate
the UserControls as wholes, rather than fiddling about with individual
panels and their contents all the time.

Jan 11 '06 #7
One more option which has not been mentioned is to "re-parent" a form to
appear in a panel in another form... I'm doing this in one of my apps and
it is by far the "cleanest" way I found.. I am quite happy with it because
there are no unusual things to do (ie, create controls, etc...) except for
the reparenting.

Basically you design each form as if it were a normal form in the VS form
designer. Then at runtime, you re-parent the form to reside inside another
form's panel or similar container. All of the events work as if it were a
standalone form, and all your code is nicely separated in the various .cs
files. When you need to display a different "page" then you close and
de-allocate the currently displayed form and create, reparent, and display
the new form. This is done with a suprisingly little amount of code.

I do not have access to my code for that from here, but here is a link to
point you to the right direction in how this is done:
http://dotnet247.com/247reference/msgs/5/28648.aspx
"Quina" <ca*********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hi. Is there someone that can tell me how can I have multiple screens
on the the same form, displaying only on at the time?

Thank you all for any replys.

Joćo Carias
Jan 11 '06 #8
Thanks Bruce, it works just fine!
I would like also to thank you all for your kind sugestions.

Joćo Carias

Jan 12 '06 #9
I am trying to do something along these lines. Whether you use user controls
or not, the problem is being able to work with the controls in the design
view, because they are all on top of each other. Is there any way to make a
control or a set of controls (a panel and its child controls) invisible *in
the design view*?
--
Dave
"Bruce Wood" wrote:
The panels thing shouldn't be too hard.

Just use Visual Studio to create a new UserControl and give it a name
indicating what one of the panels (screens) is for.

Make the UserControl as big as you need it to be, and lay out controls
the UserControl so that it looks the way you want (say) the first panel
to look. The UserControl that you created will appear as a separate .cs
(and corresponding .resx) file in your project.

Then, create a new Form class for your main application. Go the toolbox
at the left of Visual Studio and click on (I think it's) the "User
Components" section of the toolbox. You should see your UserControl
named there. Just drag it onto the design surface like you would any
other control.

Now you can use .Show() and .Hide() in your code to make the correct
panels appear / disappear when the user indicates a choice.

The only tricky part is if you want a "Back" button to go back to the
previous panel that the user was looking at, but don't worry about that
for now.

Yes, you can do this without UserControls, just by putting lots of
Panels on your design surface and laying each Panel out, but trust me:
this will quickly become a nightmare. It's a lot easier to make each
separate panel (or screen) a separate UserControl, and then manipulate
the UserControls as wholes, rather than fiddling about with individual
panels and their contents all the time.

Feb 26 '06 #10

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

Similar topics

3
by: Lizim | last post by:
Does anybody know if it is possible to write software that works across multiple monitors? and if so, is it possible to program one so it is private to the user / administrator and the other...
2
by: D | last post by:
Most of my web forms have multiple buttons (Proceed, Back, link buttons for various screens, etc.) It looks like, say a required field validator for example, gives me an error message no matter...
3
by: Martin | last post by:
Just wondered if you could give me some advice! At the moment we code out systems in COBOL and we are just starting to move everything to VB.net. Just wondering how you all manage when...
5
by: Matt C. | last post by:
I've got an application that has several distinct purposes. I'd like to make these available as different screens that the user can switch between within a single form, using commands from the...
0
by: question | last post by:
Hi! I have a requirement where I need to display multiple forms one after the other like a slide show. These are in the same application. Basicall on selection of a menu item it should start...
3
by: Steve Marshall | last post by:
I'm looking at developing an application which would benefit from being able to work with 2 display monitors. But how do I work with multiple displays? I'd like to be able to control which...
7
by: Bill Nguyen | last post by:
This has been posted before but received no response: I need to arrange window screens on the total area of a mulitple-mopnitor desktop. As an example, below is the bound info for my 2-monitor...
0
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi All, i Have an application functionaluty which has 4 forms which are needed to interact by the user by dragging data from these forms to one another the main form is located in the MDI Parent...
0
by: veerusrahul | last post by:
I am new to dotnet. I have Baseform (Windows form) with some controls & PictureBox are top right corner which is used to display the status of network. I have an application with one login...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?

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.