| Exibir mensagem anterior :: Exibir próxima mensagem |
| Autor |
Mensagem |
Netrunner Aprendiz

Registrado: Domingo, 7 de Julho de 2013 Mensagens: 236
|
Enviada: Qui Nov 14, 2013 6:35 pm Assunto: Criando Paginas PageControl e Adicionando RichEdit |
|
|
Bom, eu tenho o seguinte codigo no button
| Código: | var
Tab: TTabSheet;
REdit: TRichEdit;
Procurar:TObject;
begin
//canais = PageControl
Procurar:= Canais.FindComponent(Edit1.text);
If assigned(Procurar) Then begin
abort;
end
else
Tab := TTabSheet.Create(Canais);
Tab.Caption := edit1.text;
Tab.PageControl := Canais;
Canais.ActivePageIndex:=Tab.TabIndex;
REdit := TRichEdit.Create(Canais);
REdit.Name:= Tab.Caption;
REdit.Lines.Clear;
REdit.Parent:= Canais.ActivePage;
REdit.align := alClient;
REdit.Enabled := True;
REdit.Visible := True;
REdit.ScrollBars:= ssvertical;
REdit.ReadOnly:= true;
|
porem está dando error no button, falando que o Redit não tem parent..
 |
|
| Voltar ao Topo |
|
 |
cyberdisk Colaborador

Registrado: Domingo, 4 de Julho de 2010 Mensagens: 2391 Localização: São José dos Campos - SP
|
Enviada: Sáb Nov 16, 2013 10:31 pm Assunto: |
|
|
o erro esta nessa linha
| Código: | | REdit.Parent:= Canais.ActivePage; |
veja no help do delphi ( F1 )
| Citação: | IComponent.Parent
Indicates the interface of the component’s parent, if any.
property Parent: IComponent;
Description
The parent of a component is responsible for writing the control to a stream when the form is saved. If the component represents a control, the parent is a windowed control that visually contains the component. Not all components have parents.
Note: Don't confuse the Parent property with the Owner property. The component is always a constituent part of its parent (such as a tool button on a tool bar), while the owner is responsible for freeing the component. |
abraço _________________ O conhecimento abre muitas portas |
|
| Voltar ao Topo |
|
 |
|