1. Yuri Denshchik
  2. PowerBuilder
  3. Tuesday, 21 November 2017 22:31 PM UTC

Hello,

Microsoft has article that describes on how to handle Navigating event to cancel navigation within WebBrowser ActiveX control:

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowser.navigating?view=netframework-4.7.1

I need to add similar logic for PowerBuilder. “Navigating” event is not listed in events dropdown. How to register it? Please advise.

Thank you,

Yuri

Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 22 November 2017 13:25 PM UTC
  2. PowerBuilder
  3. # 1

I have a WebBrowser control example that you can look at. It even makes use of 'edit mode' for designing a web page.

http://www.topwizprogramming.com/freecode_webbrowser.html

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Wednesday, 22 November 2017 07:22 AM UTC
  2. PowerBuilder
  3. # 2

Hi Yuri,

use beforenavigate2 and navigatecomplete2 events.

I suggest you read this piece of art article, all your questions will be answered there.

http://pbdj.sys-con.com/node/42165

Cheers,

Marco

 

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 22 November 2017 07:02 AM UTC
  2. PowerBuilder
  3. # 3

Hi Yuri,

the reference you found is for the .NET browser control.

Here is the reference for the ActiveX control: https://msdn.microsoft.com/en-us/library/aa752043(v=vs.85).aspx

HTH

Comment
There are no comments made yet.
Lars Mosegaard Accepted Answer Pending Moderation
  1. Wednesday, 22 November 2017 04:28 AM UTC
  2. PowerBuilder
  3. # 4

If I understand your question correctly.  Depending on where the user "navigates" from.

if you are on a window and want to check the completion of a form before the window closes(*) you would use the CloseQuery() event. If you want to prevent the window from closing you return 1 in that event.  

if you are on a tab page on a tab control you can use the tab selectionchanging event.  This happens before the user changes to a different tab page, but not if the window closes or goes somewhere different.  Again return 1 to prevent change of pages and use argument oldindex to determine the tab page being navigated from.

if you are on a treeview there is also a selectionchanging event.

if you are on a datawindow, perhaps master detail, you can use the rowfocuschanging event and return 1 to prevent the user navigating to another row.

(*) Unlike browsers you can have many windows open at any given time. The user can typically navigate to another window without the previous window needing to know.  For form completion before going anywhere else, a window of type response, often with ok cancel buttons.  You could also use the deactivate event of your window, but that is not recommended as it is difficult to code successfully.

Comment
  1. Lars Mosegaard
  2. Thursday, 23 November 2017 05:07 AM UTC
From other replies I can see I didn't read your questions properly... :-(

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.