My custom controls are not allowed tab access, much like the Label control, so I would like to prevent designer-code from being generated for the property. I have tried the following:

vb.net Code:
  1. <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
  2. Overloads Property TabIndex As Int32

Those are the same attributes I use to hide other properties that I don't want to show up in the designer-generated code, because I set them at runtime. But, it does not work. I have also tried declaring TabIndex as Shadows. The TabIndex property still shows up in the designer and in the designer-generated code.

I looked at the code for Label in Reflector and saw no mention of TabIndex at all. How does it hide it?