Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 15-08-2008
Avatar de felipe88
[felipe88] felipe88 is offline
Miembro Premium
 
Registrado: may 2007
Ubicación: Mi Valle del Cauca... Colombia!!!
Posts: 1.120
Poder: 21
felipe88 Va por buen camino
Parent WebBrowser

Hola a todos,
Detallando un poco acerca de como mejorara el Programita, me surgio un problema con el WeBrowser intentando hacer esto:
Código Delphi [-]
Page := TPageControl.Create(Self);          
wb := TWebBrowser.Create(Self);
wb.Parent := Page; // Saca error
El error es Cannot assing to a read-only property cuando le intento asignar como parent el PageControl.
Cita:
Empezado por Ayuda Delphi
WebBrowser provides access to the Web browser functionality of Microsoft’s Shell Doc Object and Control Library (SHDOCVW.DLL).

Unit

ShDocVw

Description

TWebBrowser wraps the IWebBrowser2 interface from Microsoft’s Shell Doc Object and Control Library (SHDOCVW.DLL) to allow you to create a customized Web browsing application or to add Internet, file and network browsing, document viewing, and data downloading capabilities to your applications.

Note: Because TWebBrowser wraps the SHDOCVW.DLL, you must have SHDOCVW.DLL installed to use this component. This DLL ships with Internet Explorer 4 and later. Hereda del TOleControl
Entonces, ¿Como puedo asignarle el parent visual al WebBrowser?
__________________
Web
Responder Con Cita
  #2  
Antiguo 15-08-2008
Avatar de TOPX
TOPX TOPX is offline
Miembro
 
Registrado: may 2008
Ubicación: Bogotá
Posts: 527
Poder: 19
TOPX Va camino a la fama
Hola,

Código Delphi [-]
  Page := TPageControl.Create(Self);
  Page.Parent := Self;

  Tab := TTabSheet.Create(Page);
  Tab.Parent := Page;
  Tab.PageControl := Page;

  wb := TWebBrowser.Create(Self);
  TWinControl(wb).Parent := Tab;
__________________
"constructive mind, destructive thoughts"

Última edición por TOPX fecha: 15-08-2008 a las 22:19:53. Razón: Agregando más propiedades...
Responder Con Cita
  #3  
Antiguo 15-08-2008
Avatar de felipe88
[felipe88] felipe88 is offline
Miembro Premium
 
Registrado: may 2007
Ubicación: Mi Valle del Cauca... Colombia!!!
Posts: 1.120
Poder: 21
felipe88 Va por buen camino
¿Y eso era todo? ... Gracias, ya lo estoy probando...
__________________
Web
Responder Con Cita
  #4  
Antiguo 16-08-2008
Avatar de felipe88
[felipe88] felipe88 is offline
Miembro Premium
 
Registrado: may 2007
Ubicación: Mi Valle del Cauca... Colombia!!!
Posts: 1.120
Poder: 21
felipe88 Va por buen camino
Hola,
Estuve mirando este codigo proporcionado por la ayuda de Delphi para optimizar el proceso que pretendo
Código Delphi [-]
procedure TForm1.FormCreate(Sender: TObject);
const
  TabTitles: array[0..3] of ShortString = ('Customer', 'Orders', 'Items', 'Parts' );
var
  i: Integer;
  PageControl1: TPageControl;
begin
  PageControl1 := TPageControl.Create(Self);
  PageControl1.Parent := Self;
  PageControl1.Align := alClient;
  for i := Low(TabTitles) to High(TabTitles) do
    with TTabSheet.Create(PageControl1) do
    begin
      PageControl := PageControl1;
      Name := 'ts' + TabTitles[i];
      Caption := TabTitles[i];
   end;
end;
Partiendo desde aqui quise probrar algo como esto...
Código Delphi [-]
procedure TForm1.Cargar;
var pag:TStringList;
    Page:TPageControl;
    wb:TWebBrowser;
    i:Integer;
begin
  pag := TStringList.Create;
  Page := TPageControl.Create(Self);
  Page.Parent := Self;
  Page.Top := 100;
  Page.Left := 100;
  Page.Height := 300;
  Page.Width := 500;
  pag.LoadFromFile('C:\Texto.txt');
  for i:=0 to pag.Count -1 do
    begin
      with TTabSheet.Create(Page) do
        begin
          Name := 'tab' + IntToStr(i);
          Caption := pag.Strings[i];
          PageControl := Page;
          wb := TWebBrowser.Create(Page);
          TWinControl(wb).Parent := PageControl; //Esta es la duda
        end;
    end;
end;
Como lo indico en el codigo, si lo hago de ese modo aparece el WebBrowser pero no deja ver los TabSheets ya que obviamente se crea sobre estos y no dentro de estos. Entonces, si quisiera que fuera asi; ¿como debo pasar la propiedad Parent para que sea el TabSheet recien creado? ...
__________________
Web
Responder Con Cita
  #5  
Antiguo 18-08-2008
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
¿Qué tal así?

Código Delphi [-]
TWinControl(wb).Parent := Page.Pages[i]; //Esta era la duda

// Saludos
Responder Con Cita
  #6  
Antiguo 18-08-2008
Avatar de felipe88
[felipe88] felipe88 is offline
Miembro Premium
 
Registrado: may 2007
Ubicación: Mi Valle del Cauca... Colombia!!!
Posts: 1.120
Poder: 21
felipe88 Va por buen camino
Roman, muchas gracias... esa era la solucion , ya tan solo me restaria asignar el nombre a cada WebBrowser para que en otro procedimiento pueda pasarles las URL...
__________________
Web
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Parent, ParentWindow, objetos y el error Control has no parent Window dec Varios 18 07-08-2007 15:02:01
problema con parent en firefox hvelascos HTML, Javascript y otros 0 07-02-2007 20:11:57
error con el parent window antonio peña Varios 1 04-10-2006 10:18:50
TreeView parent Caro OOP 4 09-11-2005 17:37:45
Opciones de Parent pepelu1975 OOP 7 26-05-2004 18:35:36


La franja horaria es GMT +2. Ahora son las 21:59:24.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi