473,394 Members | 1,693 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,394 software developers and data experts.

How to create a user control container?

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 developers, not more
difficult. In many ways this goal is achieved. However, I've run up against
one particular area of development, where what should be a trivial excercise
is turning out to be much more difficult than it should be. I'm trying to
devleop a user control which will act as the container for other controls.

Why do I think this should be easy? Well, it used to be very easy. In VB6
all we'd need to do is set the UserControl's ControlContainer property to
True. Done.

In .NET it doesn't seem that it should be any more difficult. The following
creates a user control onto which I can drop other controls when I'm working
with this control in another project.

[Designer("System.Windows.Forms.Design.ParentContro lDesigner, System.Design,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public partial class SRSPanel : UserControl
{

OK, that works as far as it goes, however, at run time I'm experiencing a
problem which is an absolute show-stopper to my implementation. When focus
is on the last control contained within my control, and the Tab key is
pressed, focus does not move to the next control in the tab order on the
current form. Rather, a beep is issued and the cursor remains where it is.

1. Why does this happen?
2. How do I handle this?

Has anyone created a control container in .NET? Have you seen this problem?
How do you handle this?

Thanks very much for your help!

- Joseph Geretz -
Jun 6 '07 #1
4 4444
Joseph,

You are going to have to provide a complete code sample which shows what
you are experiencing. What you have given isn't nearly enough information
to go on.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:eb**************@TK2MSFTNGP02.phx.gbl...
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 developers, not
more difficult. In many ways this goal is achieved. However, I've run up
against one particular area of development, where what should be a trivial
excercise is turning out to be much more difficult than it should be. I'm
trying to devleop a user control which will act as the container for other
controls.

Why do I think this should be easy? Well, it used to be very easy. In VB6
all we'd need to do is set the UserControl's ControlContainer property to
True. Done.

In .NET it doesn't seem that it should be any more difficult. The
following creates a user control onto which I can drop other controls when
I'm working with this control in another project.

[Designer("System.Windows.Forms.Design.ParentContro lDesigner,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a")]
public partial class SRSPanel : UserControl
{

OK, that works as far as it goes, however, at run time I'm experiencing a
problem which is an absolute show-stopper to my implementation. When focus
is on the last control contained within my control, and the Tab key is
pressed, focus does not move to the next control in the tab order on the
current form. Rather, a beep is issued and the cursor remains where it is.

1. Why does this happen?
2. How do I handle this?

Has anyone created a control container in .NET? Have you seen this
problem? How do you handle this?

Thanks very much for your help!

- Joseph Geretz -

Jun 6 '07 #2
Thanks Nicholas for putting me on the right track.

Although I've built other user controls, this one is the first container I'm
building. When I came across this behavior, I thought that this is endemic
to the container aspect of the control. You asked me to put together a code
sample and I thought, OK easy enough. I put together a simple container
control and lo and behold - it works perfectly.

Right now, I'm in the process of tearing down the complexity of my container
control. When I find out what has been causing the problem I will post back
to the group.

(In the meantime, may I remove foot from mouth? ;-)

Thanks!

- Joseph Geretz -

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:ev**************@TK2MSFTNGP02.phx.gbl...
Joseph,

You are going to have to provide a complete code sample which shows
what you are experiencing. What you have given isn't nearly enough
information to go on.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:eb**************@TK2MSFTNGP02.phx.gbl...
>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 developers, not
more difficult. In many ways this goal is achieved. However, I've run up
against one particular area of development, where what should be a
trivial excercise is turning out to be much more difficult than it should
be. I'm trying to devleop a user control which will act as the container
for other controls.

Why do I think this should be easy? Well, it used to be very easy. In VB6
all we'd need to do is set the UserControl's ControlContainer property to
True. Done.

In .NET it doesn't seem that it should be any more difficult. The
following creates a user control onto which I can drop other controls
when I'm working with this control in another project.

[Designer("System.Windows.Forms.Design.ParentContro lDesigner,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a")]
public partial class SRSPanel : UserControl
{

OK, that works as far as it goes, however, at run time I'm experiencing a
problem which is an absolute show-stopper to my implementation. When
focus is on the last control contained within my control, and the Tab key
is pressed, focus does not move to the next control in the tab order on
the current form. Rather, a beep is issued and the cursor remains where
it is.

1. Why does this happen?
2. How do I handle this?

Has anyone created a control container in .NET? Have you seen this
problem? How do you handle this?

Thanks very much for your help!

- Joseph Geretz -


Jun 6 '07 #3
Strange. I tore out all functionality and re-added the code step by step.
Tabbing works just fine. I have no idea what the problem was.

Thanks for pointing me in the right direction.

Joseph Geretz

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Thanks Nicholas for putting me on the right track.

Although I've built other user controls, this one is the first container
I'm building. When I came across this behavior, I thought that this is
endemic to the container aspect of the control. You asked me to put
together a code sample and I thought, OK easy enough. I put together a
simple container control and lo and behold - it works perfectly.

Right now, I'm in the process of tearing down the complexity of my
container control. When I find out what has been causing the problem I
will post back to the group.

(In the meantime, may I remove foot from mouth? ;-)

Thanks!

- Joseph Geretz -

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:ev**************@TK2MSFTNGP02.phx.gbl...
>Joseph,

You are going to have to provide a complete code sample which shows
what you are experiencing. What you have given isn't nearly enough
information to go on.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:eb**************@TK2MSFTNGP02.phx.gbl...
>>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 developers, not
more difficult. In many ways this goal is achieved. However, I've run up
against one particular area of development, where what should be a
trivial excercise is turning out to be much more difficult than it
should be. I'm trying to devleop a user control which will act as the
container for other controls.

Why do I think this should be easy? Well, it used to be very easy. In
VB6 all we'd need to do is set the UserControl's ControlContainer
property to True. Done.

In .NET it doesn't seem that it should be any more difficult. The
following creates a user control onto which I can drop other controls
when I'm working with this control in another project.

[Designer("System.Windows.Forms.Design.ParentContro lDesigner,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a")]
public partial class SRSPanel : UserControl
{

OK, that works as far as it goes, however, at run time I'm experiencing
a problem which is an absolute show-stopper to my implementation. When
focus is on the last control contained within my control, and the Tab
key is pressed, focus does not move to the next control in the tab order
on the current form. Rather, a beep is issued and the cursor remains
where it is.

1. Why does this happen?
2. How do I handle this?

Has anyone created a control container in .NET? Have you seen this
problem? How do you handle this?

Thanks very much for your help!

- Joseph Geretz -



Jun 6 '07 #4
Ha! You did all the work, I didn't do anything. I'm glad you fixed the
problem though.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:Ox**************@TK2MSFTNGP06.phx.gbl...
Strange. I tore out all functionality and re-added the code step by step.
Tabbing works just fine. I have no idea what the problem was.

Thanks for pointing me in the right direction.

Joseph Geretz

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Thanks Nicholas for putting me on the right track.

Although I've built other user controls, this one is the first container
I'm building. When I came across this behavior, I thought that this is
endemic to the container aspect of the control. You asked me to put
together a code sample and I thought, OK easy enough. I put together a
simple container control and lo and behold - it works perfectly.

Right now, I'm in the process of tearing down the complexity of my
container control. When I find out what has been causing the problem I
will post back to the group.

(In the meantime, may I remove foot from mouth? ;-)

Thanks!

- Joseph Geretz -

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:ev**************@TK2MSFTNGP02.phx.gbl...
>>Joseph,

You are going to have to provide a complete code sample which shows
what you are experiencing. What you have given isn't nearly enough
information to go on.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:eb**************@TK2MSFTNGP02.phx.gbl...
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
developers, not more difficult. In many ways this goal is achieved.
However, I've run up against one particular area of development, where
what should be a trivial excercise is turning out to be much more
difficult than it should be. I'm trying to devleop a user control which
will act as the container for other controls.

Why do I think this should be easy? Well, it used to be very easy. In
VB6 all we'd need to do is set the UserControl's ControlContainer
property to True. Done.

In .NET it doesn't seem that it should be any more difficult. The
following creates a user control onto which I can drop other controls
when I'm working with this control in another project.

[Designer("System.Windows.Forms.Design.ParentContro lDesigner,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a")]
public partial class SRSPanel : UserControl
{

OK, that works as far as it goes, however, at run time I'm experiencing
a problem which is an absolute show-stopper to my implementation. When
focus is on the last control contained within my control, and the Tab
key is pressed, focus does not move to the next control in the tab
order on the current form. Rather, a beep is issued and the cursor
remains where it is.

1. Why does this happen?
2. How do I handle this?

Has anyone created a control container in .NET? Have you seen this
problem? How do you handle this?

Thanks very much for your help!

- Joseph Geretz -



Jun 6 '07 #5

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

Similar topics

3
by: RCCNH | last post by:
I am creating a Windows application using C# in .NET. In one of the windows, I have to show a scrollable list of user objects. Those user objects contain various controls themselves (textbox,...
0
by: Zi | last post by:
I have a user control within a data grid. I am binding the user control to one of the values from the data grid. The data grid implements paging. It is all working ok for the first page but once i...
6
by: Mary Kerrigan | last post by:
I have a user control (menu) with a data list: <asp:DataList id="MyList" runat="server"> <ItemTemplate> <asp:hyperlink cssclass="MenuUnselected" id="myLink1" Text='<%#...
4
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
6
by: Art | last post by:
Hi I'm new at this and need some help. I have a "solution" with 2 projects - the main project and a library. The library is simple, it contains a text box that will appear many times in the form...
4
by: CodeLeon | last post by:
I am designing an enhanced GUI suite, and i need to know how to: * Make a user control a "helper" control, ie, one that sits at the bottom (like timer or process) * Make this control modify the...
3
by: oozy | last post by:
Hi, I'm currently using Page.Form.DefaultButton = ChangePassword1.FindControl("xx").UniqueID to set my DefaultButtons in a form that has multiple wizards(each in it's own panel). I can...
1
by: Efi Merdler | last post by:
Hi, I created a user control, but instead of handling exception in the user control level I prefer to handle them in the containing form. In the load event of the containing form I'm using:...
2
by: Gugale at Lincoln | last post by:
Hi, I am creating a user control which has a radio button and few other controls. I would like the user control to behave like a radio button, in the sense when added to a container radio button...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
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,...
0
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...
0
tracyyun
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 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.