Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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)
    {
        return;
    }

    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?
Posted

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900