Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom Control Properties
Message
 
À
23/11/2004 06:43:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00963739
Message ID:
00964582
Vues:
5
>>I need to set up properties so that width and height can be set at design time.
>>
>>This code causes an error at design time:
>>
>>// Width property
>>public override Unit Width
>>{
>> get {return this.Width;}
>> set {this.Width = value;}
>>}
>
>Eric,
>You didn't tell the error. Check these:
>-Overridable (not sealed in parent)
>-Parent both have get and set accessors
>Cetin

Hi Cetin,

The error is "Error loading control" when dragged and dropped on to the design surface or sometimes it blows away the .NET IDE when you click the control if it was already dropped on to a webform and rebuilt with the new property override code.

I realize the height and width properties are present in the base of a server control, however the custom control by default will not resize at design time even if you type the new value into the property sheet directly and you cannot drag the border to resize the control.

The control designer does not have code to set the height and width. .NET is doing it internally based on the width of the text of the label contained in the control. The control is a span that contains a checkbox and corresponding label. So, internally the span width+height is being set by the base of ControlDesigner. What I need to know is how to enable the design time borders and property sheet so that I can resize the control like a built in checkboxlist server control.

Eric
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform