Re: Inheriting from UserControls

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Charles Law (blank_at_nowhere.com)
Date: 03/05/04


Date: Fri, 5 Mar 2004 22:33:51 -0000

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]" <craigv_@online.microsoft.com> wrote in message
news:$%23xB%23cvAEHA.600@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" <blank@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: <OHK$OW8$DHA.1224@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!TK2MSFTNGXA05.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
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
> >
> >
> >
>
>



Relevant Pages

  • Re: Basic Web Design Question
    ... 2005 or continue with inheriting a base class... ... Create a base class that all your pages inherit from, ... Use user controls, or custom server controls. ... A basic question though - is there a way of having 'common' elements on ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problems with Inheritance
    ... > causes the Designer to become confused when you are inheriting Forms ... > windows (you can leave Code view windows open... ... I have no idea what you mean by "inheriting controls from Form ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Use the Designer of a Windows Control for a Component
    ... All .NET controls under Windows.Forms assembly derive from Component. ... If you want your custom controls to be inheriting ... > Some thing like the Shape Designer sample found at. ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: Problems with Inheritance
    ... causes the Designer to become confused when you are inheriting Forms ... The Designer problems will persist until you close all open Designer ... windows (you can leave Code view windows open... ... I have no idea what you mean by "inheriting controls from Form ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Cant add controls on inherited form
    ... and everything works a treat in the inheriting form. ... happen at build time and I can add controls in the designer. ... was hasty in my response (mind you, ...
    (microsoft.public.dotnet.languages.csharp)