473,386 Members | 1,812 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.

How to have 1 toolbar to govern all...

C# .Net

My application is a one window one world one love, type of affair. There
are the occasional pop up screens, but in the main it is one window, and all
screens are displayed within this one window. Down the left hand side of my
MainWindow is a menu structure, and when you select an item, it creates an
instance of the relevant UserControl and renders it in the right hand side of
MainMenu.

Until now, each "page" or user control has its own set of buttons on it for
add,update,delete,cancel etc. Which is fine, because when the user presses a
button then the code for handling each one of these actions is within that
UserControl's code.

However.... I want to move these individual toolbars out of the individual
controls, and have one toolbar, in the MainWindow at the top. I have placed
this toolbar into my Mainwindow, and have some methods for adding and
removing buttons to it, depending on which screen I am in. But how do I tell
the control on that screen, which button has been pressed? I could I guess
use reflection to run a method in the actual control, from the ToolBar
clicked in the MainWindow, but this seems a bit bodgey.

I am new to C# and OOP, and I'm sure there is a better way, but I dont know
it. Would this be a good use for Delegates and/or Intefaces??
Oct 24 '05 #1
4 1230
As I am realizing while building a similar schema myself your objective may
be best implemented using 2.0 Master Pages. The master contains the
navigation and the content pages contain the content. Both 2.0 and Master
Pages are quite elegant. I recommend you consider migrating as early as
possible.
--
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Steve" <St***@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
C# .Net

My application is a one window one world one love, type of affair. There
are the occasional pop up screens, but in the main it is one window, and
all
screens are displayed within this one window. Down the left hand side of
my
MainWindow is a menu structure, and when you select an item, it creates an
instance of the relevant UserControl and renders it in the right hand side
of
MainMenu.

Until now, each "page" or user control has its own set of buttons on it
for
add,update,delete,cancel etc. Which is fine, because when the user
presses a
button then the code for handling each one of these actions is within that
UserControl's code.

However.... I want to move these individual toolbars out of the individual
controls, and have one toolbar, in the MainWindow at the top. I have
placed
this toolbar into my Mainwindow, and have some methods for adding and
removing buttons to it, depending on which screen I am in. But how do I
tell
the control on that screen, which button has been pressed? I could I
guess
use reflection to run a method in the actual control, from the ToolBar
clicked in the MainWindow, but this seems a bit bodgey.

I am new to C# and OOP, and I'm sure there is a better way, but I dont
know
it. Would this be a good use for Delegates and/or Intefaces??

Oct 24 '05 #2

Dont know much about 2.0 Master Pages to be honest, but think that is for
ASP?? I should have mentioned that this is a Windows based app.

"clintonG" wrote:
As I am realizing while building a similar schema myself your objective may
be best implemented using 2.0 Master Pages. The master contains the
navigation and the content pages contain the content. Both 2.0 and Master
Pages are quite elegant. I recommend you consider migrating as early as
possible.
--
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Steve" <St***@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
C# .Net

My application is a one window one world one love, type of affair. There
are the occasional pop up screens, but in the main it is one window, and
all
screens are displayed within this one window. Down the left hand side of
my
MainWindow is a menu structure, and when you select an item, it creates an
instance of the relevant UserControl and renders it in the right hand side
of
MainMenu.

Until now, each "page" or user control has its own set of buttons on it
for
add,update,delete,cancel etc. Which is fine, because when the user
presses a
button then the code for handling each one of these actions is within that
UserControl's code.

However.... I want to move these individual toolbars out of the individual
controls, and have one toolbar, in the MainWindow at the top. I have
placed
this toolbar into my Mainwindow, and have some methods for adding and
removing buttons to it, depending on which screen I am in. But how do I
tell
the control on that screen, which button has been pressed? I could I
guess
use reflection to run a method in the actual control, from the ToolBar
clicked in the MainWindow, but this seems a bit bodgey.

I am new to C# and OOP, and I'm sure there is a better way, but I dont
know
it. Would this be a good use for Delegates and/or Intefaces??


Oct 24 '05 #3
Steve,

It is not the most simple explanation that you gave.

However probably is the use of panels and that even in combination with the
splitter the most nice solution for you.

To use the panels nice have for that a look at the "Dock" property.

A nice toolbar (for your buttons) and statusbar (those both have automatic
docking on), can even make it easier and nicer.

The controls (toolbar) to make it even look nicer will be in 2.0 be extended
with more.

This kind of pages what is current you can do in different ways, because
that you have to hide all the times the panels, do you know with the simple
question. if (xPanel.Visible = true)

I hope this helps,

Cor
Oct 24 '05 #4
I didn't pick up the context of Windows Forms but if you ever need to
develop Web Forms ASP.NET 2.0 is the latest way to do so. BTW - you should
evaluate Microsoft's implementation of what they call Smart Client
architecture.

<%= Clinton Gallagher

"Steve" <St***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...

Dont know much about 2.0 Master Pages to be honest, but think that is for
ASP?? I should have mentioned that this is a Windows based app.

"clintonG" wrote:
As I am realizing while building a similar schema myself your objective
may
be best implemented using 2.0 Master Pages. The master contains the
navigation and the content pages contain the content. Both 2.0 and Master
Pages are quite elegant. I recommend you consider migrating as early as
possible.
--
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Steve" <St***@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
> C# .Net
>
> My application is a one window one world one love, type of affair.
> There
> are the occasional pop up screens, but in the main it is one window,
> and
> all
> screens are displayed within this one window. Down the left hand side
> of
> my
> MainWindow is a menu structure, and when you select an item, it creates
> an
> instance of the relevant UserControl and renders it in the right hand
> side
> of
> MainMenu.
>
> Until now, each "page" or user control has its own set of buttons on it
> for
> add,update,delete,cancel etc. Which is fine, because when the user
> presses a
> button then the code for handling each one of these actions is within
> that
> UserControl's code.
>
> However.... I want to move these individual toolbars out of the
> individual
> controls, and have one toolbar, in the MainWindow at the top. I have
> placed
> this toolbar into my Mainwindow, and have some methods for adding and
> removing buttons to it, depending on which screen I am in. But how do
> I
> tell
> the control on that screen, which button has been pressed? I could I
> guess
> use reflection to run a method in the actual control, from the ToolBar
> clicked in the MainWindow, but this seems a bit bodgey.
>
> I am new to C# and OOP, and I'm sure there is a better way, but I dont
> know
> it. Would this be a good use for Delegates and/or Intefaces??


Oct 24 '05 #5

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

Similar topics

0
by: Lauren Quantrell | last post by:
I use the following code to create text edit fields and command buttons in my toolbars: Function CreateToolbarObject(myObjectType as integer) Dim newObject Select Case myObjectType Case 1...
1
by: TD | last post by:
I created a new toolbar for my reports and need a button on it that opens (I'm not sure what the offical name of this window is) the Windows printer window where you can select which printer to...
0
by: I am Sam | last post by:
Ok whats wrong with my toolbar? When I debug I don't get an error message and the databinding is working correctly but the toolbar itself and the <iewc:ToolbarDropDownlist /> control isn't showing...
9
by: Hugh | last post by:
after I changed the image size. I tried different combinations of images sizes and button sizes. I have tried both botton and the image in the same sizes or button size was larger than that of...
6
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for...
2
by: Ahmed | last post by:
Hello everyone, I am creating a toolbar for an application. The buttons contains images and text. I set the wrappable property for the toolbar to false so the toolbar does not add another line...
3
by: Meghezel | last post by:
I want to Make DropDownMenu for toolbar(just like Back or forward buttons of browser) takes its menuitems from Contextmenu filled with array of menuItems I could not handle the event of clicking...
4
by: Steve | last post by:
C# .Net My application is a one window one world one love, type of affair. There are the occasional pop up screens, but in the main it is one window, and all screens are displayed within this...
1
by: mookid8000 | last post by:
Hello again, group! Can someone tell me a nice way to include a zoom percentage combobox in a toolbar? My first try was a workaround, where I inserted a bunch of separators where I wanted the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.