Adding a control to the Component Tray 
Author Message
 Adding a control to the Component Tray

I am trying to create a control that when placed on a form goes into the
component tray instead of the form itself.  In a nutshell I am trying to
make a control that acts like the timer control.  Thanks for the help.

Paul Gorman ><>



Tue, 28 Dec 2004 22:10:48 GMT  
 Adding a control to the Component Tray
Paul-

Hi there-

What you need to do is inherit from System.ComponentModel.Component. This
allows your class to be added to the toolbox and it will appear in the
component tray when added to a project at design time. The following example
shows you how to do this:

' Visual Basic
Public Class Class1
   Inherits System.ComponentModel.Component
End Class

// C#
public class class1:System.ComponentModel.Component
{}

Good luck!

Matthew Stoecker
Visual Basic User Education

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> I am trying to create a control that when placed on a form goes into the
> component tray instead of the form itself.  In a nutshell I am trying to
> make a control that acts like the timer control.  Thanks for the help.

> Paul Gorman ><>



Wed, 29 Dec 2004 04:29:55 GMT  
 Adding a control to the Component Tray
Thanks for the reply. One other thing. Because you can only have one
ineherits in code what type of file do you have? Will it be just a plain
class? Also, is the type of project that you use a Windows Control Library?
Thanks in advance.

Paul Gorman ><>



Quote:
> Paul-

> Hi there-

> What you need to do is inherit from System.ComponentModel.Component. This
> allows your class to be added to the toolbox and it will appear in the
> component tray when added to a project at design time. The following
example
> shows you how to do this:

> ' Visual Basic
> Public Class Class1
>    Inherits System.ComponentModel.Component
> End Class

> // C#
> public class class1:System.ComponentModel.Component
> {}

> Good luck!

> Matthew Stoecker
> Visual Basic User Education

> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.


> > I am trying to create a control that when placed on a form goes into the
> > component tray instead of the form itself.  In a nutshell I am trying to
> > make a control that acts like the timer control.  Thanks for the help.

> > Paul Gorman ><>



Sat, 01 Jan 2005 00:43:50 GMT  
 Adding a control to the Component Tray
You want to add a new Component Class to your project.  This will already
inherit from System.ComponentModel.Component.

Cameron, John, and Jeanie

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> Thanks for the reply. One other thing. Because you can only have one
> ineherits in code what type of file do you have? Will it be just a plain
> class? Also, is the type of project that you use a Windows Control
Library?
> Thanks in advance.

> Paul Gorman ><>



> > Paul-

> > Hi there-

> > What you need to do is inherit from System.ComponentModel.Component.
This
> > allows your class to be added to the toolbox and it will appear in the
> > component tray when added to a project at design time. The following
> example
> > shows you how to do this:

> > ' Visual Basic
> > Public Class Class1
> >    Inherits System.ComponentModel.Component
> > End Class

> > // C#
> > public class class1:System.ComponentModel.Component
> > {}

> > Good luck!

> > Matthew Stoecker
> > Visual Basic User Education

> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.


> > > I am trying to create a control that when placed on a form goes into
the
> > > component tray instead of the form itself.  In a nutshell I am trying
to
> > > make a control that acts like the timer control.  Thanks for the help.

> > > Paul Gorman ><>



Sat, 01 Jan 2005 03:47:44 GMT  
 Adding a control to the Component Tray
Thanks a bunch.  That worked great.  Another question.  Is there a way that
you can add item to the pop up menu when you right click on this component
in the component tray?  What I really want to do is have a form that is
sitting in my component and when someone that uses my control right click on
it in the tray there is text there saying something like "Show My Form".
WHen they click on this I want my pre designed form to come up so that they
can work with it.  Thanks in advacne again for the help

Paul Gorman ><>


Quote:
> You want to add a new Component Class to your project.  This will already
> inherit from System.ComponentModel.Component.

> Cameron, John, and Jeanie

> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.



> > Thanks for the reply. One other thing. Because you can only have one
> > ineherits in code what type of file do you have? Will it be just a plain
> > class? Also, is the type of project that you use a Windows Control
> Library?
> > Thanks in advance.

> > Paul Gorman ><>



> > > Paul-

> > > Hi there-

> > > What you need to do is inherit from System.ComponentModel.Component.
> This
> > > allows your class to be added to the toolbox and it will appear in the
> > > component tray when added to a project at design time. The following
> > example
> > > shows you how to do this:

> > > ' Visual Basic
> > > Public Class Class1
> > >    Inherits System.ComponentModel.Component
> > > End Class

> > > // C#
> > > public class class1:System.ComponentModel.Component
> > > {}

> > > Good luck!

> > > Matthew Stoecker
> > > Visual Basic User Education

> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.


> > > > I am trying to create a control that when placed on a form goes into
> the
> > > > component tray instead of the form itself.  In a nutshell I am
trying
> to
> > > > make a control that acts like the timer control.  Thanks for the
help.

> > > > Paul Gorman ><>



Sun, 02 Jan 2005 05:51:34 GMT  
 Adding a control to the Component Tray

Hi Paul,

So I don't believe you can alter the right click menu directly but you could provide a custom property on the component with a custom editor that is your form or loads your form.

Hopefully these two topics can help you here:

First to make a property on a component:
ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbconWalkthroughCreatingCompositeWFCControl.htm

Then to make your property have a custom editor:
http://samples.gotdotnet.com/quickstart/aspplus/default.aspx?url=%2fq...

Jeanie Hahn [MS]

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:

> Thanks a bunch.  That worked great.  Another question.  Is there a way that
> you can add item to the pop up menu when you right click on this component
> in the component tray?  What I really want to do is have a form that is
> sitting in my component and when someone that uses my control right click on
> it in the tray there is text there saying something like "Show My Form".
> WHen they click on this I want my pre designed form to come up so that they
> can work with it.  Thanks in advacne again for the help

> Paul Gorman ><>


> > You want to add a new Component Class to your project.  This will already
> > inherit from System.ComponentModel.Component.

> > Cameron, John, and Jeanie

> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.



> > > Thanks for the reply. One other thing. Because you can only have one
> > > ineherits in code what type of file do you have? Will it be just a plain
> > > class? Also, is the type of project that you use a Windows Control
> > Library?
> > > Thanks in advance.

> > > Paul Gorman ><>



> > > > Paul-

> > > > Hi there-

> > > > What you need to do is inherit from System.ComponentModel.Component.
> > This
> > > > allows your class to be added to the toolbox and it will appear in the
> > > > component tray when added to a project at design time. The following
> > > example
> > > > shows you how to do this:

> > > > ' Visual Basic
> > > > Public Class Class1
> > > >    Inherits System.ComponentModel.Component
> > > > End Class

> > > > // C#
> > > > public class class1:System.ComponentModel.Component
> > > > {}

> > > > Good luck!

> > > > Matthew Stoecker
> > > > Visual Basic User Education

> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.


> > > > > I am trying to create a control that when placed on a form goes into
> > the
> > > > > component tray instead of the form itself.  In a nutshell I am
> trying
> > to
> > > > > make a control that acts like the timer control.  Thanks for the
> help.

> > > > > Paul Gorman ><>



Mon, 03 Jan 2005 03:43:06 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Adding Microsoft Internet Transfer Control to components

2. moving/adding components to different control tab ?

3. can't add control in component dialog box

4. Permanently Add Non-Running Shortcut to Tray

5. Adding VB6 App to System Tray

6. Adding text to tool tray?

7. Adding icons to the system tray

8. Looking for code to add an icon to win95 system tray in vb5

9. Adding to system tray

10. Adding Clock to Tray

11. System tray icon - adding a submenu under the right-click event

12. Q: How to add a window to the system tray

 

 
Powered by phpBB® Forum Software