Just Me,
I meant this.
I was hoping to stop the code generation/appearance. Doesn't DefaultValue
only effect the value assigned in the code generated?
What is "this"? If you mean "Windows Forms Generated Code" region, then yes.
It effects the value assigned in the code generated.
Define exactly what you mean "stop the code generation/apperance" that is
different from "value assigned in the code generated". Remember we are
talking properties, not fields here.
You can use either ShouldSerialize* or DefaultValue to control if the
"setting the default" code is added to the "Windows Forms Generated Code"
region or not.
http://msdn.microsoft.com/library/d...guide/html/cpconshouldpersistresetmethods.asp
Something like:
Private Sub ResetAutoScrollMargin ()
... set AutoScrollMargin to "default" value
End Sub
Private Function ShouldSerializeAutoScrollMargin () As Boolean
... return True if you want value in "Windows Forms Generated Code"
region
End Function
Remember if you never change the value from the default, then no code is
added... Also remember that DefaultValue is a hint to the designer, you
still need to set the property's default value in the object's constructor.
You may want to ask in one of the Windows Forms newsgroups to double check,
some properties (such as Size) have other "special" properties & methods
(such as DefaultSize) that control their default value, I don't remember if
AutoScrollMargin has "special" related properties & methods.
Hope this helps
Jay