Customizing a Component

M

Mike

I don't wish to do this the hard way if VB.NET does this or most of
the work for you.

Want I want to do is customize the NotifyIcon component and for the
new component, it be nice if properties and events were inherited so
it shows up during design-time in the property editor.

However, the NotifyIcon class can not be inherited according to the docs.

Short of repeat programming the same functionality and properties and
events, is some "reflection" method, nested type or some steps to make
the custom component carry the same property members?

Thanks
 
M

Mike

Mike said:
I don't wish to do this the hard way if VB.NET does this or most of the
work for you.

Want I want to do is customize the NotifyIcon component and for the new
component, it be nice if properties and events were inherited so it
shows up during design-time in the property editor.

However, the NotifyIcon class can not be inherited according to the docs.

Short of repeat programming the same functionality and properties and
events, is some "reflection" method, nested type or some steps to make
the custom component carry the same property members?

Thanks

Well, I got it going, the LONG WAY, and because I attempted to
duplicate the properties, at least for one of them, the
NotifyIcon.Icon property, that I don't have the exact behavior. In
this case, when I drop the customize component in a form and select an
*.ICO file for the ICON file, it immediately shows up in the system
tray and when the applet is run, there are two. Obviously, a direct
notifyicon component does not do this. Related to this, is that the
custom property right click menu has a disabled Reset option to delete
the icon from the field.

So I don't have this property correct for this icon.

Basically, all I did was:

1) In the MyComponent.vb [Design] page, I dropped a NotifyIcon toolbox
component named NotifyIcon1, and

2) Adding a properties for the NotifyIcon class in the MyComponent
class, showing the Icon member only:

Public Class MyComponent

Public Property BalloonTipIcon() As Windows.Forms.ToolTipIcon
Get
Return NotifyIcon1.BalloonTipIcon
End Get
Set(ByVal value As Windows.Forms.ToolTipIcon)
NotifyIcon1.BalloonTipIcon = value
End Set
End Property

... all the other essential NotifyIcon properties coded
... the same way like above.

End Class

After compiled and added to the toolbox and dropping it to the test
form, and adding a icon file to the property, the IDE will immediately
show the icon in the tray.

Overall, the custom component is designed provide a reusable
NotifyIcon with specific automated notifications for our hosting
servers during various system events. So the custom component
combines two basic components:

NotifyIcon
Timer

Everything is working as I want it except this ICON showing up doing
design time.

Anything anyone can see I should be doing?

TIA

--
 
M

Mike

Mike said:
I don't wish to do this the hard way if VB.NET does this or most of the
work for you.

Want I want to do is customize the NotifyIcon component and for the new
component, it be nice if properties and events were inherited so it
shows up during design-time in the property editor.

However, the NotifyIcon class can not be inherited according to the docs.

Short of repeat programming the same functionality and properties and
events, is some "reflection" method, nested type or some steps to make
the custom component carry the same property members?

Thanks

Well, I got it going, the LONG WAY, and because I attempted to
duplicate the properties, at least for one of them, the
NotifyIcon.Icon property, that I don't have the exact behavior. In
this case, when I drop the customize component in a form and select an
*.ICO file for the ICON file, it immediately shows up in the system
tray and when the applet is run, there are two. Obviously, a direct
notifyicon component does not do this. Related to this, is that the
custom property right click menu has a disabled Reset option to delete
the icon from the field.

So I don't have this property correct for this icon.

Basically, all I did was:

1) In the MyComponent.vb [Design] page, I dropped a NotifyIcon toolbox
component named NotifyIcon1, and

2) Adding a properties for the NotifyIcon class in the MyComponent
class, showing the Icon member only:

Public Class MyComponent

Public Property BalloonTipIcon() As Windows.Forms.ToolTipIcon
Get
Return NotifyIcon1.BalloonTipIcon
End Get
Set(ByVal value As Windows.Forms.ToolTipIcon)
NotifyIcon1.BalloonTipIcon = value
End Set
End Property

... all the other essential NotifyIcon properties coded
... the same way like above.

End Class

After compiled and added to the toolbox and dropping it to the test
form, and adding a icon file to the property, the IDE will immediately
show the icon in the tray.

Overall, the custom component is designed provide a reusable
NotifyIcon with specific automated notifications for our hosting
servers during various system events. So the custom component
combines two basic components:

NotifyIcon
Timer

Everything is working as I want it except this ICON showing up doing
design time.

Anything anyone can see I should be doing?

TIA

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top