472,331 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,331 software developers and data experts.

Inheriting from UserControls

I want a set of controls that all have a border, like a group box. I thought
I would create a base control containing just a group box from which my set
of controls could inherit. Assuming that this is the right approach (please
tell me if it is not), how then do I make it so that the group box cannot be
moved around on my set of controls, but is also able to act as container for
other controls?

If I leave the modifier of the group box as Friend, or Private, then the
group box appears locked on the inheriting controls, but I cannot drop new
controls onto it. If I change the modifier to Protected, Protected Friend,
or Public, then I can drop controls onto the group box, but I can also move
the group box around on the inheriting control.

Is there something else I must do?

TIA

Charles
Nov 20 '05 #1
2 1710
Hi Charles,

It maybe easier to simply inherit from GroupBox. The problem is you won't
have a designer when you write the control so you'll have to do everything
in code.

Craig VB. NET Team
--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).

--------------------
From: "Charles Law" <bl***@nowhere.com>
Subject: Inheriting from UserControls
Date: Mon, 1 Mar 2004 19:44:04 -0000
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <OH**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: host81-132-105-130.in-addr.btopenworld.com 81.132.105.130Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFT NGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP11.phx.gblXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:185777
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

I want a set of controls that all have a border, like a group box. I thoughtI would create a base control containing just a group box from which my set
of controls could inherit. Assuming that this is the right approach (please
tell me if it is not), how then do I make it so that the group box cannot bemoved around on my set of controls, but is also able to act as container forother controls?

If I leave the modifier of the group box as Friend, or Private, then the
group box appears locked on the inheriting controls, but I cannot drop new
controls onto it. If I change the modifier to Protected, Protected Friend,
or Public, then I can drop controls onto the group box, but I can also move
the group box around on the inheriting control.

Is there something else I must do?

TIA

Charles

Nov 20 '05 #2
Hi Craig

I see what you mean. I have just tried it, but I think the absence of a
designer will be a problem. I want to be able to lay out my inheriting
control visually, rather than 'guess' the position of things in code.

It's a shame that inheriting from GroupBox doesn't give a designer inside a
group box.

Charles
"Craig Vick [MSFT]" <cr*****@online.microsoft.com> wrote in message
news:$%*****************@cpmsftngxa06.phx.gbl...
Hi Charles,

It maybe easier to simply inherit from GroupBox. The problem is you won't
have a designer when you write the control so you'll have to do everything
in code.

Craig VB. NET Team
--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).

--------------------
From: "Charles Law" <bl***@nowhere.com>
Subject: Inheriting from UserControls
Date: Mon, 1 Mar 2004 19:44:04 -0000
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <OH**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: host81-132-105-130.in-addr.btopenworld.com 81.132.105.130
Path:

cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFT NGXA05.phx.gbl!TK2MSFTNGP0 8.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:185777
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

I want a set of controls that all have a border, like a group box. I

thought
I would create a base control containing just a group box from which my setof controls could inherit. Assuming that this is the right approach (pleasetell me if it is not), how then do I make it so that the group box cannot

be
moved around on my set of controls, but is also able to act as container

for
other controls?

If I leave the modifier of the group box as Friend, or Private, then the
group box appears locked on the inheriting controls, but I cannot drop newcontrols onto it. If I change the modifier to Protected, Protected Friend,or Public, then I can drop controls onto the group box, but I can also movethe group box around on the inheriting control.

Is there something else I must do?

TIA

Charles


Nov 20 '05 #3

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

Similar topics

2
by: Kevin Blackwell | last post by:
This is probably a basic c# question, but I'm having problems with it. I currently have a project that contains two classes. From the calss view....
4
by: Anders K. Jacobsen [DK] | last post by:
Hi I have some common UserControls i want to share between to sites (on the same mashine but on diffrent virtual paths). right now i have on...
1
by: luminousc | last post by:
Hi guys, I'm still a relative newbie at oop, as my background has been in old fashioned vanilla ASP, so please try to make your responses as...
3
by: YYZ | last post by:
I swear I've done my research, and now I was just hoping someone could explain this to me. I've got a base class (usercontrol) that I am using...
9
by: Dominique | last post by:
I'm trying to create a C# composite control and have inherited from UserControl. This new control contains 9 buttons with images on them ( no text...
4
by: DanG | last post by:
Howdy, On past .NET projects, I only had System.Web.UI.Page forms. One application needed a set of functions to do processing against the Page,...
4
by: Nathan Sokalski | last post by:
In several of my UserControls I add properties. If I access these properties in the CodeBehind of the pages that use the controls, I recieve an...
7
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section...
0
by: SpaceMarine | last post by:
hello, i am working on a web application w/ UserControls. some of my controls use the same functionality (an Event they all raise) so it seemed...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.