|
Rank: Advanced Member Groups: Member
Joined: 3/13/2017 Posts: 33
|
I'm using the EO.WebBrowser component, and I am able to open a new vb.net Form using a WebView.NewWindow event.
On the form page, there is a 'Print' button and a 'Close' button. The Print button will print the page, but the Close button just clears out all of the data on the page, and leaves the Form open.
I'd like to be able to assign a "Me.Close" event to the existing Close button. Is it possible to do that? If so, how?
Thanks!
Kim
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
You would handle the WebView's Closed event and then inside that event handler to call Close method on the form.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 3/13/2017 Posts: 33
|
Thanks for the reply.
What I want to do is know the name of the Button in the WebView that has been clicked.
I am working with a Print window, where there is a 'Print' button and a 'Cancel' button. The Print button works fine, but the Cancel button is not working correctly.
The issue is that, when I click a "Cancel" button in a WebView, it clears all of the information off the WebView, leaving a blank screen, but it does not close the Form that the WebView is in.
How do I capture the name of the button that has been clicked in a WebView?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
You do not need to capture the name of the button clicked. The flow of events is:
1. You click "Cancel" button; 2. The JavaScript code in the page that handles the cancel button calls window.close; 3. The WebView is closed (this is why you see a blank screen); 4. The WebView's Closed event is triggered; 5. Inside your WebView's Closed event handler, you close the form;
The event flow will differ for the Print button from step 2 since you are not calling window.close in your print button's click handler.
Does this make sense to you?
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 3/13/2017 Posts: 33
|
Hi. Yes, it does make sense. I was not closing the Form when the Webview was closing. I wrote code in the Closing event to close the Form, and all is well. Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Great! Glad to hear that it works for you now.
|
|