473,378 Members | 1,360 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,378 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 1788
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. Class1 Class2 I have included a usercontrol...
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 solution file with aprox 10 projects. 2 of these is...
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 simple as possible. I'm having issues with...
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 just as an interface. Meaning, I've defined...
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 ). Firstly, what is the best way to expose...
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, Session and Request objects associated with the...
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 error when compiling. The reason for this is because...
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 As DataRow In Me.GetSections().Rows...
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 sensible to place them into a custom base class,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.