Rank: Newbie Groups: Member
Joined: 4/25/2019 Posts: 1
|
good day everyone, i would like to test the code below, but vs2015 gives me an error that "TYPE 'JSPrompt' is not defined". I hope someone can help me, thank you.
Code: Visual Basic.NET
Private Sub WebView_JSDialog(sender As Object, e As JSDialogEventArgs)
Select Case e.DialogType
Case JSDialogType.Prompt
'Create a dialog
Dim dlg As New JSPrompt(e)
dlg.Owner = Me
dlg.Message = e.MessageText
dlg.Value = e.DefaultPromptText
'Display the dialog for user input
Dim result As Nullable(Of Boolean) = dlg.ShowDialog()
'Call e.OK/e.Cancel based on whether user clicked "OK" in the dialog
If result.HasValue AndAlso Not result.Value Then
e.OK(dlg.Value)
Else
e.Cancel()
End If
Exit Select
Case JSDialogType.Alert
'Display a message box and then call e.OK to notify the browser
'engine that user has confirmed the dialog. This is important
'because either OK or Cancel must be called to prevent the default
'dialog
MessageBox.Show(e.MessageText, "JavaScript Message", MessageBoxButtons.OK)
e.OK()
Exit Select
Case JSDialogType.BeforeUnload, JSDialogType.Confirm
'Display a Yes/No message box and call e.OK/e.Cancel according
'to user's selection
If MessageBox.Show(e.MessageText, "JavaScript Message", MessageBoxButtons.YesNo) = MessageBoxButtons.OK Then
e.OK()
Else
e.Cancel()
End If
Exit Select
End Select
End Sub
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
JSPrompt is a class in our TabbedBrowser sample application. You can't just copy the code from our sample application without understanding it. We won't support you on such basic general programming issue.
Thanks!
|