The LoadSine function only loads the
settings from file and sets all the properties.
My ComponentDesigner code:
Imports System.Windows.Forms
Imports System.ComponentModel
Imports System.ComponentModel.Design
Friend Class SineEngineDesigner
Inherits ComponentDesigner
Private mDesignVerbCol As New DesignerVerbCollection()
Public Sub New()
MyBase.New()
Dim clickVerb As New DesignerVerb("Load Sine", New
EventHandler(AddressOf VerbLoadSineClicked))
mDesignVerbCol.Add(clickVerb)
End Sub
Public Overrides ReadOnly Property Verbs() As
System.ComponentModel.Design.DesignerVerbCollection
Get
Return mDesignVerbCol
End Get
End Property
Private Sub VerbLoadSineClicked(ByVal sender As Object, ByVal e As
EventArgs)
Dim OpenSineDialog As New OpenFileDialog()
Try
With OpenSineDialog
.DefaultExt = "Sin"
.Filter = "SineMaker (*.Sin)|*.Sin"
.Title = "Load Sine"
If .ShowDialog = DialogResult.OK Then
'Loading new property settings for the control
CType(Component,
SineEngines.SineEngine).LoadSine(.FileName)
End If
End With
Catch err As Exception
MessageBox.Show(err.Message)
End Try
End Sub
End Class
/ Lars-Håkan
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/ht
ml/custdsgnrdotnet.asp
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
"Lars-Håkan Jönsson" <lars-...@eqinox.com> wrote in message
news:OgfK4fM3BHA.1036@tkmsftngp04...