So, here is the (back of a cigarette packet) spec for a
new UserControl I am trying to develop -
1. It needs to be a control container
2. Scroll bars should appear if any contained control is
outside the visible area
3. A navigation button should appear if any contained
control is outside the visible area
4. Clicking the button should cause a context menu to
appear offering -
Top
Bottom
Left
Right
-
Top Left
Top Right
Bottom Left
Bottom Right
5. Clicking one of the menu options should move to the
appropriate location
6. If any contained control recieves the focus, the
container should ensure that the contained control is in
the visible region, if not then it should be automatically
scrolled into the visible region.
I have written this control in VB6 and it took me a couple
of hours. In VB.Net, I can't even get the new control to
act as a container. I have tried -
Me.SetStyle(ControlStyles.ContainerControl, True)
Me.UpdateStyles()
in the .New method but it doesn't seem to make any
difference, when a control is pasted into my new control,
it doesn't end up contained (i.e. it's parent is still the
windows form rather than my new control). I have searched
the help and various web sites for an example of a
UserControl that acts as a container (and still has a
surface that I can place the scroll bars and button on) to
no avail.
Am I missing something fundamental here? I have been
writing code for 25 years (starting out on a ZX Spectrum
and moving through GW Basic, QuickBasic versions 1 through
7 and finally all the Visual basic releases) and have
never come across anything so infuriating.
I would appreciate any help that you could offer.
Cheers, Tony Harrison
Microsoft Development Environment 2002 Version 7.0.9466
Microsoft .NET Framework 1.0 Version 1.0.3705 3 4874
yup, you need to add the ParentControlDesigner attribute to your control http://support.microsoft.com/default...b;EN-US;322222
r.
"Tony" <to***********@ashsoftware.com> wrote in message
news:1c****************************@phx.gbl... So, here is the (back of a cigarette packet) spec for a new UserControl I am trying to develop -
1. It needs to be a control container
2. Scroll bars should appear if any contained control is outside the visible area
3. A navigation button should appear if any contained control is outside the visible area
4. Clicking the button should cause a context menu to appear offering - Top Bottom Left Right - Top Left Top Right Bottom Left Bottom Right
5. Clicking one of the menu options should move to the appropriate location
6. If any contained control recieves the focus, the container should ensure that the contained control is in the visible region, if not then it should be automatically scrolled into the visible region.
I have written this control in VB6 and it took me a couple of hours. In VB.Net, I can't even get the new control to act as a container. I have tried -
Me.SetStyle(ControlStyles.ContainerControl, True) Me.UpdateStyles()
in the .New method but it doesn't seem to make any difference, when a control is pasted into my new control, it doesn't end up contained (i.e. it's parent is still the windows form rather than my new control). I have searched the help and various web sites for an example of a UserControl that acts as a container (and still has a surface that I can place the scroll bars and button on) to no avail.
Am I missing something fundamental here? I have been writing code for 25 years (starting out on a ZX Spectrum and moving through GW Basic, QuickBasic versions 1 through 7 and finally all the Visual basic releases) and have never come across anything so infuriating.
I would appreciate any help that you could offer.
Cheers, Tony Harrison
Microsoft Development Environment 2002 Version 7.0.9466 Microsoft .NET Framework 1.0 Version 1.0.3705
Hi,
Tony wrote: So, here is the (back of a cigarette packet) spec for a new UserControl I am trying to develop -
Can you not just inherit from UserControl to start with? I believe doing so
will give you all the benefits of the UserControl, to which you can add your
own functionality. I'm assuming that this isn't what you've done because you
say you cannot get it to act as a container?
-- Pete
D'oh! Ignore me I was being dumb, that other article explains it all.
-- Pete This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gilles T. |
last post by:
How I can get element ID in the edit mode of datagrid control?
If I not in the edit mode, there are no problem.
<asp:TemplateColumn ItemStyle-CssClass="grid_column_width_3"...
|
by: Alex |
last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk
The DataList is not as powerful as the DataGrid. It requires more work
from you since it has no default data presentation format....
|
by: tshad |
last post by:
This is related to my other Hiding datalistitems problem that I can't seem
to solve.
I have tried different methods which all seem to work only partially.
I decided to try to use a User...
|
by: ratnakarp |
last post by:
Hi,
I have a search text box. The user enters the value in the text box and
click on enter button. In code behind on button click i'm writing the
code to get the values from the database and...
|
by: Sam |
last post by:
Please help!
I want to create a user control that can act as a container for other
controls
(like a panel or a groupbox).
The control will consist of a panel that acts as the container for...
|
by: pabloazorin |
last post by:
I developed a Date Picker web control using C# and .net framework 1.1
I added my control to Visual Studio 2003 IDE toolbar.
When I drag and drop my control to design web page, the control renders...
|
by: Greg |
last post by:
Is there a simple way to test if a control is a container type control
(e.g. groupbox, panel etc)
I realise that all container controls have to by definition, have the...
|
by: Joseph Geretz |
last post by:
Don't get me wrong - I'm a fan of .NET; I am enthusiastic about the richness
and elegance of the environment. However, richness and elegance should be
dedicated toward making development easier for...
|
by: Doogie |
last post by:
Hi, I have been trying to get a checkbox added to a repeater control
of mine and then try to access events of the repeater control when a
user clicks the checkbox. At first, since the control is...
|
by: gerry |
last post by:
I am trying to create a custom container control that will only ever contain
a specific type of control.
At design time, when a control of a different type is added to the container
I would like...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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: 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...
| |