OnBeforeNavigate2
NewsProductsDownloadsSupportForumCredits

TEmbeddedWB 
History 
HtmlEdit 
TIEAddress 
TIEDownload 
TIEDownloadManager 
IEGuid 
TIEParser 
Favorites 
TIESecurityManager 
IE5Tools 
TIETravelLog 
TLinksBar 
Protocols 
TRichEditWB 
TWebUpdater 
ResourceTool 
UI - lessParser 
Delphi Links 

 

 

[Home][Support][TEmbeddedWB][Events][OnBeforeNavigate2]


OnBeforeNavigate2OnCommandStateChangeOnDocumentCompleteOnDownloadBeginOnDownloadCompleteOnFullScreenOnGetExternalOnGetHostInfoOnGetOptionKeyPathOnMenuBarOnNavigateComplete2OnNavigateErrorOnNewWindow2OnQuitOnProgressChangeOnPropertyChangeOnScriptError EventOnShowContextMenuOnShowDialogOnShowHelpOnShowMessageOnStatusBarOnStatusTextChangeOnTheaterModeEventOnTitleChangeOnToolbar EventOnTranslateAcceleratorOnTranslateUrlOnUpdateUIOnVisible

 

OnBeforeNavigate2

 

OnBeforeNavigate2Write an OnBeforeNavigate2 event handler to redirect or cancel or change navigation. This event fire as the result of a call to the Navigate or Navigate2 method, or when the user clicking on a link.
In simple words, here is the place to cancel navigation to a url or open new window.
This important event also uses to prevent Popup windows.
Its use is simple, just write
Cancel:= True to prevent the navigation.
Command Arguments:

Sender
The TEmbeddedWB component for which the event is being generated. Usage: (Sender as TEmbeddedWB)
pDisp
The IWebBrowser component for which the event is being generated. This is the top level browser if: (pDisp as IWebBrowser) = (Sender as TEmbeddedWB).DefaultInterface
URL
The URL that is to be navigated to.
Flags
Not currently used.
TargetFrameName
Name of the frame in which the URL is to be displayed (if named), otherwise nil.
PostData
TBD
Headers
TBD
Cancel
Flag allowing the browse operation to be cancelled or blocked. Set True to cancel the browse, False to allow it to go ahead. Has the value False on entry.



 
procedure TfrmMain.EmbeddedWB1BeforeNavigate2(ASender: TObject;
  const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
  Headers: OleVariant; var Cancel: WordBool);
begin
   If CheckBox1.Checked  then Cancel:= True
  else Cancel := false;
end;

[Home][News][Products][Downloads][Support][Forum][Credits]

Copyright (c) 2005 bsalsa productions. All rights reserved.

bsalsa@bsalsa.no-ip.info