Thanks,
Good idea, this fixes the problem in a very simple way. you know i have to "unlearn" VFP.
>Stephane,
>
>I wouldn't have handled the maximize/minimize boxes that way. A cleaner way is to handle it in the custom Resizable property's set method:
>
>public bool Resizable
>{
> get {return this._Resizable;}
> set {
> this._Resizable = value;
> 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;
> }
>}
>
>
>~~Bonnie
>
>
>
>>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