W
Wimpie van Lingen
Hi
I've created a control that inherits from the button control. The control
has one additional property called ButtonType which can be set to Ok,
Cancel, New, Edit, etc. When the ButtonType property changes, the Image,
Text, TextAlignment, etc. properties are changed for the control.
What happens is that when I put the control on a form and I set the
ButtonType property, all the fields that are changed are then highlighted as
changed and written in the Form.Designer.vb file to initialize those
properties. How can I prevent this from happening?
At the moment, the following is written:
Me.DialogButton1.Location = New System.Drawing.Point(359, 133)
Me.DialogButton1.Cursor = System.Windows.Forms.Cursors.Hand
Me.DialogButton1.ButtonType = ButtonTypeEnum.Arrow_Next
Me.DialogButton1.Font = New System.Drawing.Font("Tahoma", 9.0!)
Me.DialogButton1.Image =
CType(resources.GetObject("DialogButton1.Image"), System.Drawing.Image)
Me.DialogButton1.ImageAlign =
System.Drawing.ContentAlignment.MiddleRight
Me.DialogButton1.MaximumSize = New System.Drawing.Size(90, 28)
Me.DialogButton1.MinimumSize = New System.Drawing.Size(90, 28)
Me.DialogButton1.Size = New System.Drawing.Size(90, 28)
Me.DialogButton1.Text = "&Next "
Me.DialogButton1.TextAlign = ContentAlignment.MiddleRight
Me.DialogButton1.TextImageRelation =
TextImageRelation.TextBeforeImage
Me.DialogButton1.Name = "DialogButton1"
Basically most of those properties are already set when the control is
created or when the ButtonType property is set. So basically all I want to
appear in the form designer is:
Me.DialogButton1.Location = New System.Drawing.Point(359, 133)
Me.DialogButton1.ButtonType = ButtonTypeEnum.Arrow_Next
Me.DialogButton1.Name = "DialogButton1"
Any ideas how I can do that?
Regards
Wimpie
I've created a control that inherits from the button control. The control
has one additional property called ButtonType which can be set to Ok,
Cancel, New, Edit, etc. When the ButtonType property changes, the Image,
Text, TextAlignment, etc. properties are changed for the control.
What happens is that when I put the control on a form and I set the
ButtonType property, all the fields that are changed are then highlighted as
changed and written in the Form.Designer.vb file to initialize those
properties. How can I prevent this from happening?
At the moment, the following is written:
Me.DialogButton1.Location = New System.Drawing.Point(359, 133)
Me.DialogButton1.Cursor = System.Windows.Forms.Cursors.Hand
Me.DialogButton1.ButtonType = ButtonTypeEnum.Arrow_Next
Me.DialogButton1.Font = New System.Drawing.Font("Tahoma", 9.0!)
Me.DialogButton1.Image =
CType(resources.GetObject("DialogButton1.Image"), System.Drawing.Image)
Me.DialogButton1.ImageAlign =
System.Drawing.ContentAlignment.MiddleRight
Me.DialogButton1.MaximumSize = New System.Drawing.Size(90, 28)
Me.DialogButton1.MinimumSize = New System.Drawing.Size(90, 28)
Me.DialogButton1.Size = New System.Drawing.Size(90, 28)
Me.DialogButton1.Text = "&Next "
Me.DialogButton1.TextAlign = ContentAlignment.MiddleRight
Me.DialogButton1.TextImageRelation =
TextImageRelation.TextBeforeImage
Me.DialogButton1.Name = "DialogButton1"
Basically most of those properties are already set when the control is
created or when the ButtonType property is set. So basically all I want to
appear in the form designer is:
Me.DialogButton1.Location = New System.Drawing.Point(359, 133)
Me.DialogButton1.ButtonType = ButtonTypeEnum.Arrow_Next
Me.DialogButton1.Name = "DialogButton1"
Any ideas how I can do that?
Regards
Wimpie