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?? 4 1232
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??
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??
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
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?? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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: 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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |