Tengo varios días tratando de corregir este error, solo me da en tiempo de diseño, basicamente es un TEdit multi-uso (Alianeación, numeros con formato, decimales, un caracter fijo, etc), el componente funciona perfectamente en run-time, pero en Design-time me da el error: 'Control "TEditEx1" no has parent window' y lo borra del formulario. He leido varios foros (en ingles) y no dan una solución concreta solo dicen que el error se da en "CreateWnd" de TWinControl. Pongo el código para que se den una idea...
Código Delphi
[-]
constructor TCustomEditEx.Create(AOwner: TComponent);
begin
Inherited Create(AOwner);
FRangeChar := [];
FFixedChar := #0;
FFixedPos := fpLeft;
FHasSign := False;
FDecimals := 0;
FThousands := False;
FNumPadDot := False;
FValidChars := [];
FPorcent := False;
Formating := False;
_FixedChar := False;
FCreating := True;
FAlignment := taLeftJustify;
FRangeChar := [rcNumber, rcAlpha, rcSymbol, rcExtended];
end;
procedure TCustomEditEx.CreateWnd;
var
FixedWidth: LongInt;
begin
FCreating := True;
try
inherited CreateWnd;
finally
FCreating := False;
end;
if FFixedChar <> #0 then
begin
if FFixedPos = fpLeft then
FixedWidth := MakeLong(GetFixedWidth, 0)
else
FixedWidth := MakeLong(0, GetFixedWidth);
SendMessage(Handle, EM_SETMARGINS, EC_LeftMargin or EC_RightMargin, FixedWidth);
end;
end;
procedure TCustomEditEx.CreateParams(var params: TCreateParams);
const
Styles : Array [TAlignment] of DWORD = (ES_LEFT, ES_RIGHT, ES_CENTER );
begin
inherited;
params.style := params.style or Styles[FAlignment];
end;
destructor TCustomEditEx.Destroy;
begin
inherited Destroy;
end;
Elimine todo posible llamada al Api o al VCL usando tecnicas de Borland pero nada, sigue el mismo error...
Si quieren todo el resto del código, solo diganme donde subirlo
Estaba identado, no se que paso cuando lo pegé... :-p