No KeyDown detected on a new Window presented with ShowDialog (a mouse click is required before working)

Hello,
I shorter the code.
In MainWindow I have a button to open a SecondWindow 
private void ButtonNextWindow_Click(object sender, RoutedEventArgs e)
            WindowState = WindowState.Minimized;
            var secondWindow = new SecondWindow();
            secondWindow.ShowDialog();
            WindowState = WindowState.Normal;
In the second window class I declared a KeyDown event called onKeyDown
private void onKeyDown(object sender, KeyEventArgs e)
            MessageBox.Show("Key Pressed");
well... it works only if I first click in the Second Window with the mouse, wherever I want.
I would avoid this click; seems something related with the Keyboard focus.
Thanks in advance,
Vincenzo

Set second window to focus after you set first window state to normal
private void ButtonNextWindow_Click(object sender, RoutedEventArgs e)
            WindowState = WindowState.Minimized;
            var secondWindow = new SecondWindow();
            secondWindow.ShowDialog();
            WindowState = WindowState.Normal;
secondWindow.Focus();

Similar Messages

  • Firefox will not open new windows, opens with session restore every time I use it, and won't let me open the throubleshooting tab... Why?

    Whenever I try to open a new window, nothing happens. This includes clicking ctrl+N and through the drop down menu.
    Also, whenever I start firefox to browse the internet, it always open with a Session Restore with the previous session listed, even though I closed all the tabs and shut it down normally without any prompts telling me about saving multiple tabs.
    Finally, when I tried to troubleshoot this problem, the tab never appeared. The only options that work on the Help Menu are:
    - Firefox Help (after a few clicks)
    - Report Broken Web Site
    - Check for Updates
    - About Firefox

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    There are other things that need your attention.
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    *Shockwave Flash 10.0 r45
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://kb.mozillazine.org/Flash
    *http://www.adobe.com/software/flash/about/

  • When I am NOT private browsing Firefox will not allow me to delete or change the website address in the location bar. My only remedy is to open a new window and search in google then click the link to that site through google. How can I resolve this?

    Question
    When I am NOT private browsing Firefox will not allow me to delete or change the website address in the location bar. My only remedy is to open a new window and search in google then click the link to that site through google. When I swap to private browsing firefox allows me to anter the website address directly into the location bar - but this is a slow [prcess to swap back and forth - also by dint of using private browsing I loose my website information.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • I have a new Windows laptop with iTune that is not recognizing my iPhone 5?

    I have a new Windows laptop with iTune that is not recognizing my iPhone 5? I have the latest version of iTune and when I open iTune it comes up with an error message that " the registry settings used by the itunes driver for importing and burning CDs and DVDs are missing" Thismessage always come up, even after installing the latest version of iTunes.

    Same is here
    Have a MacBook Pro , upgraded to Lion and now cannot download music from CD to ITunes "... An unknown error occurred (-50)".
    Help

  • A new window does not open when I click on the new tab "plus" sign. How do I fix this?

    A new window does not open when I click on the new tab "plus" sign. How do I fix this?

    Try uninstalling the Ask toolbar and it should work again. There is a compatibility issue with the Ask toolbar and Firefox that prevents new tabs from being opened.

  • What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?

    What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?
    a. PowerShell
    b. isql
    c. osql
    d. sqlcmd

    All questions seem to be from the interview or a test. I think I even took this test once, it's KForce test.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Using Firefox 3.6 after a few mouse click/ keyboard input the firefox window is no more active, mouse click and keyboard input is inactive ; then I click on the taskbar and the keyboard is active again during a few click then it stops again etc.

    Using Firefox 3.6 after a few mouse click/ keyboard input the firefox window is no more active, mouse click and keyboard input is inactive ;
    to solve it I click on the taskbar and the keyboard is active again during a few click then it does not work any more and I click again on the task bar etc.
    after several repetitions, I have to call the task manager alt+del+ctrl, then come back to the firefox window to be able to use keyboard and mouse again

    Attaching the picture for the tab shape I want...

  • HT5639 I have downloaded Windows 8 on my Mac Pro 13'' retina display. The first few hours everything worked fine until I open windows today and the trackpad/mouse and keyboard aren't working. Ive tried resetting windows but it didnt work. help appreciated

    I have downloaded Windows 8 on my Mac Pro 13'' retina display. The first few hours everything worked fine until I open windows today and the trackpad/mouse and keyboard aren't working. Ive tried resetting windows but it didnt work. help appreciated thanks

    It sounds like it is time to restore from the backups you made just before making the disk changes.
    You can re-partition and restore your backups.  If you didn't make backups first (you were warned that it might damage things and to make sure you had a good backup) then you will need to repartition everything and reinstall from scratch...

  • Skype doesn't detect webcam on new windows 8 lapto...

    I have a new laptop pre-shipped with windows 8. I installed skype via the skype download page, and after the install I see that it does not detect my webcam.
    I go to Tools->Options and skype doesn't detect that any webcam exists on the system.
    I've changed the windows 8 webcam privacy settings to allow skype to use my webcam, though I'm not clear if this affects the normal old desktop skype or that new metro skype (I'm not even quite clear if those are two separate applications, that whole metro thing is still just weird and unuseable to me, not sure why I'd ever want skype to take over the whole desktop as it does if you go into it from the metro interface).
    There are tons of results for webcams not woring in skype, but after going through many of them they don't seem to cover this case of "skype just doesn't detect the webcam in windows 8".

    -Leon- wrote:
    the F1/2/3/4/5/6/7/8/9 dont work for me to turn on my webcam please help!
    Please,  run the DirectX diagnostics tool.
    Go to Windows Start  and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.

  • Handling new window open with WebView

    Hi,
    I'm developing an app where I use webview to display a webpage. The webpage has a link where a file gets downloaded automatically when selected. What I'm trying to do is to get the link of the downloadable file and try to download it from my app. The problem
    I'm facing is that IE automatically opens whenever the downloadable link is pressed. I cant get event handler to detect this scenario. I've seen there could be a solution using Javascript but I dont know how to implement it. I found there is x-ms-webview.MSWebViewNewWindowRequested
    but this one is for Windows 10 only. I wonder if there is an alternative solution for WP8.1. Thanks

    Hi Rob,
    Now I've tried two solutions and none of them worked as expected. Here are the options
    1) In the WebView.NavigationStarted, I download the html content and then modify it to remove target=_blank which triggers opening a new window. I then call  WebView.NavigateToString to call the new html content. Looks like it works somehow but
    the reloaded page does not contain images, links, etc. Is there a way to fix this?
    2) I've tried the solution described in this link:
    http://stackoverflow.com/questions/18799534/notify-click-action-on-button-in-webview
    which is essentially injecting javascript code to handle button clicks.  The code looks like this:
    private void WebView_OnLoadCompleted(object sender, NavigationEventArgs e)
    webView.InvokeScript("eval", new[]
    "var loginButon=document.getElementById(\"login\");" +
    "if (loginButon.addEventListener) {" +
    "loginButon.addEventListener(\"click\", clickFunction, false);" +
    "} else {" +
    "loginButon.attachEvent('onclick', clickFunction);" +
    "} " +
    "function clickFunction(){" +
    " window.external.notify('loginClick');"+
    However, I get error when the code executes webView.InvokeScript (Execption:0x80020101). Do you have any idea why?
    Kind Regards

  • Can someone help me understand why the search engine will not do anything when I click the search icon or press enter, and why new windows won't open when I click on a link that should open one?

    When I type something in the search engine at the right hand corner of the screen it will not allow the search to take place. What I mean is I either click the icon or press enter and nothing happens. I would understand it better if it at the very least gave me a error message. I have also noticed that things like the opening of a new window via a link will not work. An example is I was just on www.walmart.com and when I clicked on an image in order to see a larger one no window opened. I also recently noticed that when I had a lot of tabs open the shortcut menus and menus in general did not load completely or really at all keeping me from saving the pages as bookmarks. I know this could be from low internet speed, a lot of tabs etc..., but I've had many more tabs open than I had then and it worked. Plus all I did was delete or close one tab and suddenly it worked. I then recovered the tab and it still worked even though I was back at the original amount of tabs. I have the latest version of firefox, not counting the beta, and I don't know of any way to solve the two main problems.

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Getting a smaller duplicate of my firefox page everytime I open a new window and I have to close it out, nothing is working and even ran a virus scan- getting f

    Geez, have to go to 10 different things to even get here!!!! I am having a problem with getting a smaller version of firefox every time I open a new window but it is blank, it looks like your web page, I have to close it out to view my page I was opening. I ran a virus scan and there is nothing. I have windows and firefox is my home page, btw when I go to IE I do not have this problem, Seems like when firefox installs a new version something happens,.

    Try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://hacks.mozilla.org/2010/09/hardware-acceleration/
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • All of a sudden when i click any button or link a new window opens with an ad

    I have used Firefox for about 7 years. No issues...
    I recently installed Ghostery add on.
    The only way to describe it is:
    I go to a page..
    Click a link (or close to it) or enter or any other button/link that would take me to what I expect..
    BUT instead it opens a new tab to an advertisement site (quibids, P&G, many other random ads) - a few of them I blacklisted with BLOCKSITE (installed after the problem started happening) but several I can't because I would actually use them when I need to (ex: Vistaprint.com)
    When I go back to the original site and click the same link and click it again it works as intended.
    This happens across all sites that I am on...
    It is like there is a hidden link within the one I am clicking on.
    I have pop ups blocked in my browser but this gets around it somehow.
    Since GHOSTERY installed, some sites do not work correctly. If I click on a picture, or something that I want to expand it is as if I am doing nothing at all because it won't complete the action, the functionality is broken.
    I have white listed a couple sites but this is random and if I whitelist everything I come across then it opens me back to what I am trying to avoid..
    EXAMPLES:
    went on Heat.com, clicked the button to go to the White Hot Gear instead it opened a new tab brandonline.com
    was on LinkedIn and hit the comment button on a thread, then it opened a new tab vistaprint.com
    was on publix.com, hit the order refills button, then it opened a new tab premium-promos.net
    did a google search clicked on the link I wanted, it opened a new tab premiumgiftrewards.net
    EACH time I go back to the original site and click the same button/link/etc it takes me where expected.
    Thanks in advance for your help!

    Both Firefox and IE have the same problem. The cursor instead of being a finger when pointing to a link is still an arrow. However I can click anywhere on the page and an ad will pop up. I have eliminated all unwanted bars in Firefox, I ran Malwarebytes until it came out clean. I also have AVG which had detected a few items on it's own. But when I get into Firefox I still have exactly the same problem. Now it will not let me download Browser Safeguard. Usually after one click the pointer returns to normal for a few screens. When I try to click to download Browser Safeguard it keeps bringing up different ads or it tries to get me to upgrade Firefox or some other browser helper program which I know are all BS tactics to get me to load their junk again. PLease help I'm an engineer and pretty good with PCs but this one has me beat at least so far.

  • New window manager (with prototype!) [wmii-like] --- looking for help

    I have a prototype for a new window manager in the style of wmii. It is called
    cakewm. I currently have a prototype version implemented in pygame, and would
    like help moving this to use X---making it a real window manager.
    Disclaimer: I have a very limited knowledge of X11 and window manager
    development. The most I've done is add a couple new features to wmfs.
    To get the code
    > git clone git://github.com/saikobee/cakewm.git
    Then run main.py. cakewm depends on pygame.
    Upon running, press Alt-Enter to fullscreen cakewm and intercept keybinds, or
    Alt-Space to just intercept keybinds.  Press Alt-Esc to quit. The window
    manager related keybinds are listed in the file binds.conf.
    Config note: <WSCA-x> means Windows-Shift-Control-Alt-x
    Implementation note: pypixel.py is a large and mostly useless dependency. I
    forked a library I made previously rather than coding straight in pygame.
    cakewm's goals are to be similar to wmii, but with more functionality, easier
    configurability, and saner defaults.
    - cakewm is fully functional using the keyboard. Mouse support can come later.
    - cakewm provides 9 workspaces per monitor.
    - cakewm manages each workspace as a group of columns. Each column is like a
      wmii default split, except each window can have other windows "stacked" on
      top of or behind it.
    - cakewm manages column sizes (and window sizes within columns) using a
      master/slave paradigm, with the ability to adjust the size ratios.
    - cakewm's configuration file is simple key=val pairs, with the ability to
      include other files like in C.
    - cakewm has a slightly larger emphasis on window decorations (adjustable
      size---even in tiled mode) and themes (nothing bloated, like pixmaps or
      gradients---it's all still simple colors).
    - cakewm will have proper support for international text (Japanese text in
      window titles or the wmii status bar generally render as boxes) through the
      use of a more advanced text library such as Pango.
    Please let me know if you have comments, questions, or concerns. If you are
    interested in helping, get in touch with me. If you know somewhere better to
    look for volunteers, please let me know.

    m4co wrote:
    Wow is this forum active. Makes me feel welcome here
    The thing about wireless, I actually like command line, but there are a few things that are worth having a applet or something.
    And wireless is one of those. I guess I can take a look on wicd.
    It's a good idea to have compiz as the WM actually. Would it be lightweight to have it like that?
    Is there anybody here that uses compiz as a WM?
    For the xfce4-panel, is it possible to get transparency on it? That's probably the only thing holding me back with xfce4-panel.
    If "able to run compiz" wasn't a requisite, what other WM would you suggest for my "profile" ?
    I would like to hear other users opinions who like to customize everything on a WM.
    I recommend running Compiz by itself. There is a good wiki page on it in the Arch wiki. Some apps you'll want to go with it are:
    LXAppearance --change GTK/icon theme
    Feh or Nitrogen --Set Wallpaper
    Xfce4-panel --The lightest one that works with Compiz properly
    Or, if you don't want a panel: stalonetray
    Compiz-deskmenu --For a customizable right-click main menu
    Gmrun --Run dialog (Alt+F2 in most DEs)
    And this helped me a lot.
    Thank you all for the replies. I appreciate.
    Xfce4-panel can have transparency.  The only problem is that everything become transparent: text, icons, everything.
    I use Compiz as a standalone WM and it is much lighter than DE+Compiz. My Compiz setup uses about 30MB(out of 1GB) more RAM than my Openbox setup (which are both the same except for the WM).

  • Complete web pages (in the form of ads basically) pop up without being prompted in a new window even with adblocker on.

    A few times per day, on average, a new web page will appear in a new window...basically marketing their product or solution. I have ABP turned on. I'd like to know how I can prevent this from occurring.

    Hi,
    I have the same issue, but the thing is, "Warn me when web sites try to redirect or reload the page" is OFF, and about:config shows that "accessibility.blockautorefresh" is false.
    So everything should be OK, however I constantly get the "This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?" message, and it's utterly annoying.
    Any ideas? I would appreciate any help! Thanks!

Maybe you are looking for

  • Issue with smart tv freezing

    Just got new smart tv and keeps freezing when I go to the home page? The only way to get it out of the home page is to unplug the tv. It will work until you go into the home page 2-3 times and it will freeze up on the home screen. Any suggestions?

  • XML Web Service Question

    Hello, I have been asked to research a way to export data from the SAP BW into a remote application. I know nothing about SAP and I have a few questions. We would like to take data from SAP BW and put it in an XML file. Then we would like to automati

  • Installing InDesign CS4 on new Mac computer

    I just purchased a new Mac computer with the OS X 10.9 software. I'm trying redownload my InDesign CS4 from the adobe site and it's not letting me download the program? Any suggestions?

  • IPhone 5 blu mute switch

    My iPhone 5 mute button is blue, i thought it was normal. But i've also saw an other iPhone 5 with red one, confused !

  • Pixma IP4950 B200 Error

    I have a Pixma IP4950 B200 error. I printed 10 6x4 pictures then tried to print a 'printable' CD when I got the error along with 6 flashing amber lights,  on some occasions it flashed 10 ambers alternatively with the green light.. I'm confused: The 6