Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > .NET Framework 1.x
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2006, 08:15 AM
Registered User
 
Join Date: Feb 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Toolbar switching / dynamic population

Hello members,

I am new to DotNet and have a problem.

I am developing a Windows Forms MDI application using C#.

I need to switch the toolbars or, to be more precise, need different buttons/icons on the toolbar depending on which child window is active. Each Child window has its own set of toolbar buttons. (for eg. Order screen has its set of buttons, while Customer has its set of buttons). Also when all child windows are closed, and only the MDI window is active, it needs to display a different set of buttons. There will also be some common buttons for all the child windows, such as for Cut,Copy,Paste,Exit,Lookup,Search etc.

What is the best way to do this ?
1. Create a separate toolbar for each child window ? But in this case, the toolbar does not get attached to the MDI window. It gets attached to the indicidual child windows. Also it means I have to create that many toolbar and imagelist objects as the number of modules that I have ( 60+).

2. Or can I just create a single toolbar which is attached to the MDI window, but somehow, at runtime, depending on which child window is active, make a different set of butons appear on the toolbar. In this case how do I specify what is to be executed when a toolbar button is clicked. Also, the same button may need to different things depending on the module in which it has been clicked (for eg. clicking on "Analyse" button calls different database procedures depending on the active module)

Example situation.
Application loads. MDI window is displayed with toolbar having only two buttons, Connect and Disconnect.

User activates Order screen from the menu. Order window opens and the toolbar now displays the buttons relevant to the Orders module.

While Orders module is open, user now opens Customers module. When the Customers window loads, the toolbar now displays the buttons relevant to the Customer module.

User clicks on the Orders window and makes it the active window. Again the toolbar must show the buttons relevant to the Orders module.

Kinldy help out. Looking forward to your responses.

Thanks,
yamyam





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic ListBox Population n Selection nkrust ASP.NET 2.0 Basics 1 January 9th, 2007 05:05 AM
Dynamic Subform Generation & Population kindler Access 4 December 13th, 2005 01:59 PM
Datagrid Population jayabhatia .NET Web Services 3 November 6th, 2003 11:10 AM
Datagrid population KennethMungwira ADO.NET 1 November 6th, 2003 11:06 AM
Datagrid Population jayabhatia .NET Web Services 1 October 31st, 2003 11:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.