Sorry for the delay in getting this to you --- I've gotten pulled off to
another project, and haven't checked the groups for a while.
That being said, the following code needs a lot of cleanup (haven't gotten
back to it since asking the ?) but it should get you going in the right
direction.
The issue that I was having after creating the class was how I was declaring
it --- it's a little obtuse --- here is a snippet that shows the declaration
code that works:
(sorry my newgroup reader is really screwing up the formatting here, but if
you paste to VS it should fix it for you)
Imports System.ComponentModel.Design
Imports System.Windows.Forms
Public Class MyDesignSurface
Inherits DesignSurface
Private mHost As IDesignerHost
Private mDesignerOptionService As DesignerOptionService
Sub New()
MyBase.New()
mHost = DirectCast(Me.GetService(GetType(IDesignerHost)), IDesignerHost)
' set up the designer option service
mDesignerOptionService = New MyDesignerOptionService
MyServiceContainer.AddService(GetType(DesignerOptionService),
mDesignerOptionService)
End Sub
Without further delay here is the DesignerOptionService class!!! (yeah, it's
ugly and needs tons of work, but will help get you going in right direction)
Imports System.ComponentModel.Design
#Region " Snapline stuff "
Class MyDesignerOptionService
Inherits DesignerOptionService
Public Sub New()
End Sub
'/ <summary>
'/ Populates an option collection with the settings for the DesignSurface.
'/ </summary>
'/ <param name="options"></param>
Protected Overrides Sub PopulateOptionCollection(ByVal options As
DesignerOptionCollection)
If options.Parent Is Nothing Then
Dim opt As Windows.Forms.Design.DesignerOptions = New
Windows.Forms.Design.DesignerOptions()
'opt.UseSmartTags = True
opt.UseSnapLines = False
opt.SnapToGrid = True
opt.ShowGrid = True
'opt.ObjectBoundSmartTagAutoShow = True
Dim wfdc As DesignerOptionCollection = Me.CreateOptionCollection(options,
"WindowsFormsDesigner", Nothing)
Dim wfdgc As DesignerOptionCollection = Me.CreateOptionCollection(wfdc,
"General", opt)
End If
End Sub
End Class
#End Region