I have a form which is shown from a child form. Before a long running process I change the cursor using Cursor = Cursors.WaitCursor; However when I run the app, the cursor doesn't change to an hour glass. I even tried to do it for the mdi form. Only when I click on the form while the long running process is running do I get an hourglass and "(Not Responding)" form title.
What am I missing?
Related
I've got a WPF form inside a window and a short series of events like this:
1) 1st form has series of selection buttons
2) Clicking a button brings up a progress bar window over the existing window
3) Progress window closes and 1st form switches to a new 2nd form using page navigation
The problem is that the 2nd form (and the entire window) no longer has any focus and what's really killing me is that the window is no longer getting OnKeyDown() calls (it's still the top winow). If I hit the tab key the first menu option is highlighted and the following key stroke will fire a OnKeyDown(). Also, if I alt-tab to another app and then alt-tab back to my window it will begin receiving OnKeyDown() again.
How do I figure out where the focus is after the dialog?
If you are using navigation then the focus will have switched to the Page that you have navigated to, assuming that it is Focusable.
You can check that by setting up a breakpoint in a Focused event handle for the Page.
Alternatively you can use an explicit control.SetFocus() in the page.Navigated handler.
I am showing wait cursor with image (System.Drawing.Bitmap) in a windows form and it is not flashing when i click on button and start flashing after event is executed.
As per my understanding wait cursor form did not get focus when event fired and start flashing after event executed
I want to perform this task when user clicks on button event and stop when code end.
I am using vb.net with framework 4.0
Thanks
Cursor.start()
//ur code
Cursor.stop() !!
simple is that what you wanted??:S if yes mark as answer
I'm screen scraping a page that includes a link that spawns a popup window that is comprised of a select list and a button to execute your selection. The objective is to click the link on the main page, make a selection on the pop-up window, click the link to confirm the selection and then view the new selection on the main webpage.
Here are the steps that I'm taking in Celerity and the results:
popup_browser = browser.image(:alt, 'Holidays').click_and_attach
#this creates a new browser to deal with the popup window
popup_browser.select_list(:id, 'ddlSlot1').select_value('Christmas')
#Selecting Christmas from the select list
popup_browser.link(:id, 'btnChangeHoliday').click
#Confirms/Implements selection
popup_browser.close
#Closes popup browser
puts browser.div(:id, 'HolidayName').text
#Here I try to print the updated holiday but nothing is printed (no text value)
Everything seems to work fine except for the last line. I've done some debugging and have confirmed that my selection has been made. It seems that the main webpage is not being updated after I click the ChangeHoliday button on the popup page.
Any thoughts or suggestions would be appreciated.
Thanks in advance for you help.
This turned out to be an easy fix. The only change required for the script to work is to add the resynchronize option to the browser initialization. After doing so the script works as expected.
browser = Celerity::IE.new(:resynchronize => true)
I'm trying to show a context menu when I left-click a NotifyIcon. Just calling NotifyIcon.ContextMenuStrip.Show() doesn't work very well. A solution has been posted here before that calls a secret method using Reflection:
Dim mi As System.Reflection.MethodInfo = GetType(NotifyIcon).GetMethod("ShowContextMenu", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
mi.Invoke(Icon, Nothing)
This works great, except that I also need to control where the menu is shown. I want to wait for the SystemInformation.DoubleClickTime to elapse between receiving the NotifyIcon.MouseUp event and displaying the menu, so that I can handle single-clicks and double-clicks separately. But invoking the ShowContextMenu method displays the menu at the current mouse position when ShowContextMenu is called, not when the icon was actually clicked. Which means that if the mouse moved during the DoubleClickTime, the menu will be displayed in a different part of the screen. So if I can control where the menu is shown, I can just save the mouse coordinates when I receive the MouseUp event, and then I can ensure that the menu is displayed near the icon. Is there a way to do this?
Thanks in advance.
Well, I just discovered that there are existing programs that exhibit this same behavior. I just went through all the icons in my system tray and about half of them do it. If you left-click the icon and then move the mouse during the delay before the menu appears, the menu will appear at the last mouse location, wherever that is on the screen. Snagit is one application that does this. Outlook is the only program in my tray that always shows the menu where I clicked the icon. But Snagit looks like it's using a .NET ContextMenuStrip, while Outlook is probably using a native menu.
So either this is standard behavior, or it's a problem that no one else has been able to solve either. And as a user, I've never noticed this behavior until yesterday when I was testing my own application. So I guess it's not that big of a deal and I won't worry about it.
In my Windows Mobile project, I have a form (let's call it form M to help keep thing straight) that I need to display modally, so I am using the ShowDialog method on a new copy of the form. When I show it from a form (form A) that takes up the whole screen (WindowState Maximized, Location 0,0, all other properties default except for name, the designer picks this up and shows it without a title bar), it shows up fine with the title bar intact.
However, if I display another modal window on top of this form (form B) that takes up the whole screen and uses the same form properties as form A, and then try to show the modal dialog form M from that form, the title bar is not visible and I can see the top part of form B behind it. Form M also has all default properties except for ControlBox False, and as such shows up in the designer with the title bar.
Any ideas as to what to look for? I have tried just about every combination of manipulating the properties of the parent and modal forms (WindowState, FormBorderStyle, ControlBox, TopMost, etc.) and have not found a combination that works yet.
It exhibits the same behavior both in the Windows Mobile 6 Classic emulator and on my device.
Here is what the form M is supposed to look like, which it does when shown on top of form A:
Good Form http://imagebin.antiyes.com/images/0710161001266357909_33.png
And when form M is displayed on top of form B (and form A):
Bad Form http://imagebin.antiyes.com/images/0020949001266357931_33.png
(These screen captures are taken from my Dell Axim X51V, which has a 480x640 screen.)
This project worked fine in the past, I just converted it from VS2005 to VS2008, and I am wondering of something in the conversion is causing this to happen.
EDIT: I noticed that this is happening with other forms with title bars in my application that try to show on top of form B, and it is exhibiting the same behavior. If when this happens, I press the Calendar hardware button to open up the calendar application, and then press Ctrl+Q (I am using MyMobiler for screen shots and keyboard control of the device), the Calendar window goes away and the form M shows up, this time with the title bar showing just fine.