Click here to Skip to main content
14,272,096 members
Rate this:
Please Sign up or sign in to vote.
There was a following situation with an event handler

private void Bt_Click(object sender, RoutedEventArgs e)
    if (MessageBox.Show("Yes or No", "?", MessageBoxButton.OKCancel) != MessageBoxResult.OK)

    HyperlinkButton hb = new HyperlinkButton()
        NavigateUri = new Uri(HtmlPage.Document.DocumentUri.OriginalString.Split('#')[0] + "#/ViewTask1", UriKind.Absolute),
        TargetName = "_blank"
    (new HyperlinkButtonAutomationPeer(hb) as IInvokeProvider).Invoke();

After a long pause before pressing OK on MessageBox new tab does not appear. But if remove the question or quick answer Yes (pressing the space on the keyboard) opening tabs is successful.

Help Me, Please
How to open a new tab after answer Yes?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100