Sendkey Ctrl+a Ctrl+c Does Not Work Properly With Webview2-control

Skip to content Dismiss alert {{ message }} / WebView2Feedback Public
  • Notifications You must be signed in to change notification settings
  • Fork 62
  • Star 508
  • Code
  • Issues 1.2k
  • Pull requests 31
  • Discussions
  • Actions
  • Wiki
  • Security

    Uh oh!

    There was an error while loading. Please reload this page.

  • Insights
Additional navigation options Sendkey ctrl+a ctrl+c does not work properly with webview2-control #564New issueNew issueClosedClosedSendkey ctrl+a ctrl+c does not work properly with webview2-control#564@Taminox

Description

@TaminoxTaminoxopened on Oct 22, 2020

I try to copy the displayed document content to a texbox.

Environment: Windows 10 Home, Visual Studio Community 2019 Version 16.7.5, VB.net, .net framework 4.8.03752

Public Sub WebView_NavigationCompleted(sender As Object, e As CoreWebView2NavigationCompletedEventArgs) Handles wv.NavigationCompleted wv.Focus() Clipboard.Clear() SendKeys.SendWait("^a") SendKeys.SendWait("^c") tb.Text = Clipboard.GetText() End Sub

The copy command works, but after that the clipboard content is not available by Clipboard.gettext() and the text selection in Webview2 is not visible. On the other hand the clipboard content is available while using ctrl+v manually in the textbox or using Notepad.

Without line "tb.Text = Clipboard.GetText()" text selection ist visible. Any other line following the copy command (e.g. "MessageBox.Show("xxx") instead of "tb.Text = Clipboard.GetText()") leads to the same effect.

Inserting a sleep command does not help.

Metadata

Metadata

Assignees

No one assigned

Labels

No labelsNo labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You can’t perform that action at this time.

Từ khóa » Visual Basic Sendkeys Ctrl+c