
Windows forms designer automatically adds code that sets properties of custom controls
I created a custom textbox control.
Public Class EMRTextBox
Inherits System.Windows.Forms.TextBox
Public Sub New()
Me.Font = New Font("Arial", 20.0!, FontStyle.Regular)
End Sub
End Class
I have this control in a separate project that compiles into a DLL. I then
import that project's dll into another project. I then added the controls on
my toolbox and finally drag and drop an instance on a form.
The form does the following in the code page:
Friend WithEvents EmrTextBox1 As EMRControls.EMRTextBox
<System.Diagnostics.De{*filter*}StepThrough()> Private Sub InitializeComponent()
Me.EmrTextBox1 = New EMRControls.EMRTextBox()
Me.SuspendLayout()
'
'EmrTextBox1
'
Me.EmrTextBox1.Font = New System.Drawing.Font("Arial", 20.0!)
Me.EmrTextBox1.Location = New System.Drawing.Point(120, 40)
Me.EmrTextBox1.Name = "EmrTextBox1"
Me.EmrTextBox1.TabIndex = 0
Me.EmrTextBox1.Text = "EmrTextBox1"
QUESTION:
How do I make it so that the forms designer does not set certain properties
at design time?
I was able to find out some info that seemed to indicate that I needed to
use DesignerSerializer but I'm not sure.
Thanks,
John