>private int _Distance = 0; >[Description("Returns or sets the distance of the control from the left or top edge of the parent container")] >[DefaultValue(0)] >[Browsable(true)] >[Category("Stuff")] >public int Distance >{ > get { return _Distance; } > set > { > if (value > -1) > { > _Distance = value; > > if (_Orientation == Orientation.Horizontal) > { > Top = _Distance; > } > else > { > Left = _Distance; > } > > } > else > { > throw new Exception("Invalid value"); > } > } >} >>
>this.MyControl.Location = new System.Drawing.Point(273, 66); >this.MyControl.Name = "MyControl"; >this.MyControl.Size = new System.Drawing.Size(5, 150); >this.MyControl.Distance = 15; >this.MyControl.TabIndex = 0; >>