Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AfterInitializeComponent() ??
Message
 
À
12/11/2004 12:23:27
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00960888
Message ID:
00960930
Vues:
7
Thanks Bonnie,

I did that and it works but, what happend is the form appear and for a split second you can see the MaximizeBox And MinimizeBox disapear if my custom property Resizable if false. It's just not very clean. Any ideas ?

heres the code:
protected internal void AfterInitializeComponent()
{
	
	// Resisable
	this.MaximizeBox = this.Resizable;
	this.SizeGripStyle = this.Resizable ? System.Windows.Forms.SizeGripStyle.Show : System.Windows.Forms.SizeGripStyle.Hide;
	this.FormBorderStyle = this.Resizable ? System.Windows.Forms.FormBorderStyle.Sizable : System.Windows.Forms.FormBorderStyle.FixedSingle;
	this.MinimizeBox = this.Resizable;
				
	
}
>Stephane,
>
>The base class's constructor executes in it's entirety before the derived class's constructor, so you wouldn't be able to put a call to an AfterInitializeComponent() in the constructor of the base class. But, a class's Load event fires next (after both constructors, base and derived), so you could put a call to an AfterInitializeComponent() in your base class's Load event handler (which will execute in it's entirety before the derived class's Load event).
>
>~~Bonnie
>
>
>
>>Another C# newbie question...
>>
>>I want to put in a base class, code that would execute right after the Default constructor of the derived class.
>>
>>Where would i put this code ? And make sure it'always executed.
>>
>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform