TabPage question 
Author Message
 TabPage question

I am writing my own TabControl, and I was wondering how I can prevent the
user from adding my TabPage class to the toolbox. I noticed that when I
customize the toolbox, and look in the control list,
System.Windows.Forms.TabPage is not there.

Nate



Tue, 22 Jun 2004 03:34:59 GMT  
 TabPage question
Hello Nate,

I think you may use the "internal" access modifier. It limits your TabPage
class can only be accessed from the project in which you create your
TabControl class. If you want to It is also can be accessed from the
inherited class of your TabControl class. You may define your TabPage class
inside the TabControl class and use the "protected internal" access
modifier. For more information about the protected internal access
modifier, please see:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cssp...

I hope this is helpful.

Best regards,

Lion Shi, MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2001 Microsoft Corporation. All rights
reserved.
--------------------

    Subject: TabPage question
    Date: Thu, 3 Jan 2002 14:34:59 -0500
    Lines: 8
    Organization: MHz Software
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

    Newsgroups: microsoft.public.dotnet.languages.CSharp
    NNTP-Posting-Host: 216.41.48.114
    Path: cpmsftngxa07!tkmsftngp01!tkmsftngp02
    Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:32298
    X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

    I am writing my own TabControl, and I was wondering how I can prevent
the
    user from adding my TabPage class to the toolbox. I noticed that when I
    customize the toolbox, and look in the control list,
    System.Windows.Forms.TabPage is not there.

    Nate



Fri, 25 Jun 2004 17:38:07 GMT  
 TabPage question
But if I use internal, then won't the user not be able to create instances
of my TabPage class?

Nate


Quote:
> Hello Nate,

> I think you may use the "internal" access modifier. It limits your TabPage
> class can only be accessed from the project in which you create your
> TabControl class. If you want to It is also can be accessed from the
> inherited class of your TabControl class. You may define your TabPage
class
> inside the TabControl class and use the "protected internal" access
> modifier. For more information about the protected internal access
> modifier, please see:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cssp...
Quote:
> /vclrfcsharpspec_3_5_1.asp

> I hope this is helpful.

> Best regards,

> Lion Shi, MCSE, MCSD
> Microsoft Support Engineer

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use.  2001 Microsoft Corporation. All rights
> reserved.
> --------------------

>     Subject: TabPage question
>     Date: Thu, 3 Jan 2002 14:34:59 -0500
>     Lines: 8
>     Organization: MHz Software
>     X-Priority: 3
>     X-MSMail-Priority: Normal
>     X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>     X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

>     Newsgroups: microsoft.public.dotnet.languages.csharp
>     NNTP-Posting-Host: 216.41.48.114
>     Path: cpmsftngxa07!tkmsftngp01!tkmsftngp02
>     Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:32298
>     X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>     I am writing my own TabControl, and I was wondering how I can prevent
> the
>     user from adding my TabPage class to the toolbox. I noticed that when
I
>     customize the toolbox, and look in the control list,
>     System.Windows.Forms.TabPage is not there.

>     Nate



Sat, 26 Jun 2004 01:29:26 GMT  
 TabPage question
Hello Nate,

Your TabPage control appears in the toolbox because you are in the same
solution which creates the TabPage class. If you create another new
solution and add a reference to the .DLL or .EXE file which contains your
TabPage control, only your TabControl control can be added to the toolbox.
I think it is the result you want.

The only thing you need to do is inherit the class from the TabPage and
create a new solution referring it:

public class MyTabPage : System.Windows.Forms.TabPage

I have tested it on Visual Studio .NET RC1 based on WIndows XP and it
worked.

Best regards,

Lion Shi, MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2001 Microsoft Corporation. All rights
reserved.
--------------------



    Subject: Re: TabPage question
    Date: Mon, 7 Jan 2002 12:29:26 -0500
    Lines: 64
    Organization: MHz Software
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

    Newsgroups: microsoft.public.dotnet.languages.csharp
    NNTP-Posting-Host: 0-1pool188-6.nas25.somerville1.ma.us.da.qwest.net
63.159.188.6
    Path: cpmsftngxa09!cpmsftngxa07!tkmsftngp01!tkmsftngp04
    Xref: cpmsftngxa09 microsoft.public.dotnet.languages.csharp:32722
    X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

    But if I use internal, then won't the user not be able to create
instances
    of my TabPage class?

    Nate



    > Hello Nate,
    >
    > I think you may use the "internal" access modifier. It limits your
TabPage
    > class can only be accessed from the project in which you create your
    > TabControl class. If you want to It is also can be accessed from the
    > inherited class of your TabControl class. You may define your TabPage
    class
    > inside the TabControl class and use the "protected internal" access
    > modifier. For more information about the protected internal access
    > modifier, please see:
    >
    >

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cssp...
    > /vclrfcsharpspec_3_5_1.asp
    >
    > I hope this is helpful.
    >
    > Best regards,
    >
    > Lion Shi, MCSE, MCSD
    > Microsoft Support Engineer
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    rights.
    > You assume all risk for your use.  2001 Microsoft Corporation. All
rights
    > reserved.
    > --------------------

    >     Subject: TabPage question
    >     Date: Thu, 3 Jan 2002 14:34:59 -0500
    >     Lines: 8
    >     Organization: MHz Software
    >     X-Priority: 3
    >     X-MSMail-Priority: Normal
    >     X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    >     X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

    >     Newsgroups: microsoft.public.dotnet.languages.csharp
    >     NNTP-Posting-Host: 216.41.48.114
    >     Path: cpmsftngxa07!tkmsftngp01!tkmsftngp02
    >     Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:32298
    >     X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
    >
    >     I am writing my own TabControl, and I was wondering how I can
prevent
    > the
    >     user from adding my TabPage class to the toolbox. I noticed that
when
    I
    >     customize the toolbox, and look in the control list,
    >     System.Windows.Forms.TabPage is not there.
    >
    >     Nate
    >
    >
    >
    >



Sat, 26 Jun 2004 17:09:52 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to display richtextbox scrollbars on a tabpage?

2. Newbit: help with TabPage and Controls

3. Adding objects to a tabpage programmitically

4. TabControl tabpage change

5. Catching the TabPage change event?

6. Broken Show() and Hide() for Forms.Form.TabPage

7. dynamically adding separately created tabpage to tabcontrol

8. Hide a TabPage

9. is it possible to show Form on TabPage ?

10. TabPage - OnChange

11. Get the TabPage from a MouseClick???

12. Activating a tabpage

 

 
Powered by phpBB® Forum Software