Windows forms designer automatically adds code that sets properties of custom controls 
Author Message
 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.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"

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.



Mon, 03 Oct 2005 13:38:50 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Create custom control in form using code (code wizard adding ocx to form)

2. Windows Form Designer generated code

3. Set Custom Property Value through a VB Form

4. Adding a custom property to a form

5. How to set all forms to the same custom menu using code

6. How to set programmatically set values of custom added columns

7. Custom Property Designers and Parent objects?

8. prohibit form designer to call a property on a form

9. Setting values to Custom Fields on Custom Forms

10. Custom Property changes in Custom Outlook Form

11. Form Designer vs. Add Form

12. How to add code to custom added dialogbox setup installation


Powered by phpBB® Forum Software