The following code no longer works and will not navigate to the url. On some of our older machine i have had to put a 3 second timer to get it to navigate after creation for it to work when before it worked fine using the oninitialized. This is using delphi 10.3
unit Unit1;
interface
uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,*
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, AdvCustomControl, AdvWebBrowser, AdvWebBrowser.win;*
type
- TForm1 = class(TForm)*
- procedure FormCreate(Sender: TObject);*
- procedure FormDestroy(Sender: TObject);*
- private*
- { Private declarations }*
- DigiWebBrowserEdge: TAdvWebBrowser;*
- procedure DigiWebBrowser1ContextPopup(Sender: TObject; MousePos: TPoint;var Handled: Boolean);*
- procedure OnInit(Sender: TObject);*
- public*
- { Public declarations }*
- end;*
var
- Form1: TForm1;*
implementation
*{$R .dfm}
procedure TForm1.DigiWebBrowser1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
begin
- Handled := True;*
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
-
DigiWebBrowserEdge := TAdvWebBrowser.Create(Self);*
-
TWinControl(DigiWebBrowserEdge).Parent := Self;*
-
DigiWebBrowserEdge.align := alClient;*
-
DigiWebBrowserEdge.AlignWithMargins := False;*
-
DigiWebBrowserEdge.HandleNeeded;*
-
DigiWebBrowserEdge.OnContextPopup := DigiWebBrowser1ContextPopup;*
-
DigiWebBrowserEdge.OnInitialized := OnInit;*
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
- FreeAndNil(DigiWebBrowserEdge);*
end;
procedure TForm1.OnInit(Sender: TObject);
begin
- DigiWebBrowserEdge.Navigate(VarToStrDef('http://www.google.com',''));*
end;
end.
Thanks for any help
Lee