Windows Mobile ShowDialog form's title bar is not visible - winforms

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.

Related

The whole app shifts towards left when Internet Explorer is not expanded to its whole width and length

I have reduced the length and width of IE browser window. The app loads properly for the first time. Now I have a form which opens on the click of a button on my Homepage. In the form, if I leave a field invalid and I click on save, the code is written such that if there is any field invalid, it will focus on the invalid field. So, with IE10 browser window small, when I leave a field in this form invalid and click on save, the whole app shifts towards left inlcuding the form and the fields inside the form. I have no clue why this is happening. I am using the following code to focus on the invalid field,
child.getEl().dom.scrollIntoView();
I am aware that there is some bug with scrollIntoView when using IE browser. Can someone suggest me the alternative to scrollIntoView()? Thanks in advance!
Used the foloowing instead of scrollIntoView(),
1) field.getEl().focus() to focus on invalid field
2) panel.body.el.scrollTo('Top',0,true) to scroll the form to the top every time we open it

WPF window and element focus

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.

Customizing Navigation Buttons' Bar in MS Access Form

I am creating a form in MS Access. My form appears to the user in form of a modal pop-up box. At the bottom of the form we get Navigation Buttons, New Entry (which I have disabled), Filter and Search Options.
I want to customize this Navigation Button Bar. For example, I do not want 'Record' word to appear at the left most position in this bar.
I have been searching ways to do the same. I am not sure if the same can be achieved, but still hopeful.
Thanks in anticipation.
Jay
You can disable Navigation Buttons in form properties, which means the bar does not appear and in Access 2007 and 2010, you can set the Navigation Caption, which means you can have something instead of "Record", but you cannot customize the bar itself.
If you must have custom navigation, disable the bar and add your own navigation options.
You can change the Record into something else, but not customize the other bits of the navigation bar as far as I know.
Will show as:
If you want to go further than that, you may be able to intercept windows messages and change the wording on the fly, but that would complex and certainly a lot of work for not much.
On the other hand you could simply not show the navigation bar and create your own navigation using buttons and a bit of VBA instead.

WPF + PRISM - show modal popup window with controls in it?

I am following the 'Stock Trader RI' example by the Prism team,
but it does not address this exactly :
I have a Shell with a Main Region in it.
In this shell I have some filter fields and a grid.
When I press on a button - I would like to load a screen that allows me to change the filters,
and then press 'Save'. This would then call a service to update the fields, and close the pop-up.
Here is an illustration of the 'Shell' before pressing the button (left) and after (right) :
Problems are :
The 'Stock Trader RI' sample app only uses a modaless dialog popup. I need a MODAL pop-up (background will continue to refresh, but user will not have access to it as long as pop-up is active).
Need to have Silverlight-like effect when pop-up shows, meaning - 'Shell' needs to appear 'disabled' (like a gray mask over it).
Pop-up window should have no 'X' button and no 'minimize' or 'maximize' buttons. The pop-up window should be simply a rectangle with curved-corners.
I don't think I can use a 'Notification Window' or a 'Confirmation Window' because I cannot put inside them whatever I want. This is an example with 2 fields, but the pop-up might be much more complex with tabs, and a lot of information shown to the user.
So how do I show a modal pop-up from my "WPF+PRISM" Shell-View-Model once the 'Edit' button is pressed ? (Meaning, once the 'EditCommand' is executed...)
I have found a solution here.
Basically it uses InteractionRequest and it allows me to open a window (that I can style however I want, without the 'Maximize' 'Minimize buttons), and also - I can choose for it to be Modal.
Great thing about this solution is - that I can use custom pop-ups and not only Notification or Confirmation pop-ups.
Also - I can pass information back to the class the invoked the 'InteractionRequest'.
Only thing that it doesn't solve - is that I cannot make the calling view look disabled by adding a gray semi-transparent over it ... haven't figured out yet how to do that...

Show NotifyIcon Context Menu and Control Its Position?

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.

Resources