I'm implementing a Windows application in C# .Net 2.0. On many
of the forms I need to have record navigation capabilities
(forwards, backwards, first, last etc) which I chose a to do
with a toolbar containg 7 buttons or so.
1. Rather than recreating the same toolbar (navBar) in the dozen
or so locations I need it, is this a case where I could use
the UserControl?
2. Regardless, is it a simple matter to make the UserControl
accessible in the forms design mode?
Thanks,
- Jamie 1 1068
In this case easier way is to subclass form with toolbar.
Suppose you create form with toolbar ToolForm. Derive your other forms from
it.
class MyNewForm : ToolForm {
....
}
You might need to add properties to ToolForm to get to events for toolbar
buttons, but it should not cause any difficulties.
UserControl itself is placeholder where you put additional controls. Then
you should put it on corresponding form. Slightly more and unnecessarily
complex for your case and with design hassles (positioning, attaching events
etc.).
HTH
Alex
"Jamie Risk" <risk.#.@intect us.comwrote in message
news:OG******** ******@TK2MSFTN GP06.phx.gbl...
I'm implementing a Windows application in C# .Net 2.0. On many of the
forms I need to have record navigation capabilities (forwards, backwards,
first, last etc) which I chose a to do with a toolbar containg 7 buttons
or so.
1. Rather than recreating the same toolbar (navBar) in the dozen
or so locations I need it, is this a case where I could use
the UserControl?
2. Regardless, is it a simple matter to make the UserControl
accessible in the forms design mode?
Thanks,
- Jamie
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sascha |
last post by:
Hi there,
I searched carefully through the web before finally deciding to post
this message, because I could not find a solution for my problem.
Hopefully someone will have a hint or explanation for me! I apologize
for the length of this posting, but I wanted to make sure that I get an
answer other than "Hey man, just use LoadControl!", because this is not
what I want.
The Task: Isolate a collection of web forms which are created as
|
by: Agnes |
last post by:
I create my own usercontrol which is , my purpose is set all textbox's font into the
same. Now , I can do it by using the following code
Protected Overrides Sub InitLayout()
Me.Font = New System.Drawing.Font("SimSun", 8)
.........
However, during design mode I want to set the font into larger size e.g font
size 9, I can run it sucessfully in the 1st time, if I amend the form during
design mode again, the font size changed back to '8'...
|
by: JohnR |
last post by:
In it's simplest form, assume that I have created a usercontrol,
WSToolBarButton that contains a button. I would like to eventually create
copies of WSToolBarButton dynamically at run time based on some
initialization information obtained elsewhere. Basically, I'm going to
create my own dynamic toolbar where the toolbarbuttons can change. I'm not
using the VB toolbar because of limitations in changing things like
backcolor (I can't get...
|
by: Joe |
last post by:
Hello All:
Do I have to use the LoadControl method of the Page to load a UserControl?
I have a class which contains three methods (one public and two private).
The class acts as a control server. It "serves" back the required control
(either WebControl or UserControl) based on the contents of an xml file. The
code in the webform places each control in a TableCell.
My problem is that the control server works as far as returning the...
|
by: Marcelo Cabrera |
last post by:
Hi,
I have a user control that in turn creates a bunch of webcontrols
dynamically and handles the events these webcontrols raise. It used to work
fine on ASP .Net 1.1 but when compiled on 2.0 it does not. The problem is
that the webcontrols get created on the OnLoad event of the usercontrol and
the event handlers are assigned at the same time. I have to click twice on
the controls for the events to be raised, the first time nothing...
| |
by: Mark Collard |
last post by:
The ToolBar control allows you to add toolbar buttons. When you add a button,
the button is not only displayed in the toolbar, but also added as a
separator control in the form/usercontrol your toolbar exists in.
I'm writing my own usercontrol which contains various different controls
(e.g. Panel, Button). I would like these controls to be listed in the drop
down just above the Properties grid, when a new instance of the usercontrol
is...
|
by: MeowCow |
last post by:
I have created a UserControl that encapsulates a third party data grid.
My goal was to create my own DataSource and DataMember properties that
forward the binding to the third party grid, then use binding like
normal.
The problem I am running into is that my UserControl ends up with a
different BindingContext then the ParentForm it is contained in and
thus all other controls on the parent form. (I want various controls
on the form to...
|
by: arncota |
last post by:
Hi,
I created a UserControl, and created its UI with the designer. Next,
I wanted to create a subclass of that UserControl, with a new UI. But
when I open it in the designer, I see the UI components from the
parent class. When I step through the code, it looks like the
InitializeComponents of my base UserControl is getting called, and
then the version in my subclass.
Is there any way to prevent this? Is there a better way to create
|
by: Frank Rizzo |
last post by:
In the WinForms context.
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |