drag and drop - vb.net - windows

I am implementing Drag & Drop in windows application. I have
Main Form (Has a toolbar with Search, Open, Print etc) - MdiContainer
On Search - Open a child - Search form.
Drag and Drop a file to a Grid on this search form.
In DragDrop event of the Grid - Call a Modal form.
I am having trouble here.
When i drag and drop a file on to a selected record in the grid, i am able to call a modal form in Grid_DragDrop event. But this modal form blocks everything until it is closed instead of just blocking access to the application. Also when i move this modal form around, i see trail of form moving and it does not go away until i close the form.
I am able to call the same modal form on a button click and able to move it around. No trail of form and it refreshes fine. It only blocks the application and not the desktop.
I am clueless about why this is happening only when i call modal form in DragDrop event?

Showing modal forms from DragDrop event is REALLY bad idea. Basically you make your app go haywire because it cannot do what windows require of it during DragDrop (including redrawing both DragDrop source (desktop?) and target).
Use DragDrop event ONLY to register what is being dropped and then process it afterwards.

Related

Delphi - How to programmatically make a modal dialog react like an event similar clicking on the background form

In our application, a modal dialog is shown that the user needs to confirm/close before other interaction is possible/allowed. This dialog is a self-implemented form, so can be adjusted to our needs.
An external event (in our case: a scan from a manual barcode scanner) provides input for the application. When the dialog is in front of the application, I would like to inform the user the scan/input is not processed. An idea is to simulate the behaviour that happens when clicking the form in the background of the modal dialog. By default, Windows then lets the dialog borders 'flash' and a sound is heard ('bonk' sound as described here: Delphi - How do you generate an event when a user clicks outside modal dialog?).
My question is:
Is it possible to programmatically simulate that behaviour, in order
to let user know the dialog has to be closed first?
Additional question: is this proper UI handling or should the dialog itself display an additional info text (e.g. as a footer text) instead of just 'flash'. I like to avoid displaying another modal dialog on top of the first one; to me that not seem best practice as well.
Thank you for any feedback/solution.
Use the FlashWindow or FlashWindowEx functions to achieve this.

Menu becomes non-responsive in VB6 code on Windows 10

I have some old VB 6.0 code that I need to get running on Windows 10. We are not allowed to use Compatibility mode due to security and client refusal issues.
The only problem I am having is that whenever a button is clicked on the interface the menu items (across the top) become unresponsive. If you mouse over them the shading changes but clicking does not drop down the menu. Additionally, if I generate a message box pop up and click OK the menus come back to life.
I've tried setting focus to the main form in different situations, tried refreshing the parent and child forms. Also added a brand new button with no code behind it - not even an empty click event handler - and that button when clicked causes the same issue.
I should also add that the main form is an MDI form with three child forms. The buttons of course reside on the child forms.
I'm not sure how to proceed with this at this point. I certainly can't have a message box pop up after every button is clicked. Has anyone seen this before or have any ideas as to what causes it?

Upload dialog in Chrome and Firefox on Mac doesn't disable mouseout event for the page element

My task is to implement a file upload form in a popup sub-menu panel. I am using XmlHttpRequest, so it's important to keep that popup opened until I receive an event status that file loading completed/failed. Onmouseover and onmouseout events are used to show/hide the popup.
On "hide" the popup panel is detached from the DOM, and cannot be used anymore as a listener for XHR events.
When I click form's "Browse" button, a system dialog window is opened above the browser. In IE, Chrome and Firefox in Windows the system dialog disables events handling by page. Which means if you move a mouse cursor out of the dialog window on one of the page element, the page won't do anything like reacting on mouseOver/mouseOut events. Unfortunately, in case with Chrome/Firefox on Mac (Safari is OK) the page elements do react on mouse over/out. And my popup menu becomes closed (due to mouseOut event handler for the popup) -> XHR response is not managed properly.
Assuming having an upload form in a popup is a must, what are the possible ways of keeping that panel/form visible while system Upload File dialog window is up? Probably a Mac specific solution.
Sample code can be seen here http://jsfiddle.net/xqvXG/
Solved this by freezing popup panel and covering the whole page with transparent div ('glass').
In case if user chooses file(s) and upload starts, I remove the glass and unfreeze the popup using the XHR function readyStateChangeHandler (or may do that in handler of load event).
If user clicks Cancel in system dialog window or closes it with "X" button - no events passed to the page and 'glass' remains on screen. Then any click on the 'glass' causes its removal and unfreezing (or simple hiding) the popup menu.
'Glass' is required to make a single one-click point (panel) for unfreezing the popup in case if Cancel/Close were pressed.
I wouldn't say this is a perfect solution (sometimes required extra action), but very close to what I was looking for.

How to load second view in Preference window cocoa

I am developing a cocoa application for mac. I have created a preference window with four buttons in toolbar. I am loading views on click event of buttons. Its working fine.
What I want to know is how to load another view on click of button in a view. Like in preference window of Safari, there is tab named with Privacy. And there is a button 'Details...' in Privacy tab. When we click on that button it shows a new view which shows a list of cookies.
Any Idea how to load view like view loaded on click of 'Details...' button???
There are several approaches, depending on what you're trying to accomplish. The easiest is probably to create the view you want, but make it hidden when you don't want it to be visible. Then when the user presses the "Details…" button, make it visible (and possibly expand the window if necessary) by calling [-NSView setHidden:NO].
Another way is to make the view a separate view in your .nib file, and when the "Details…" button is pressed, insert the view into the appropriate window using [-NSView addSubView:].
You could also create the view at runtime when the user presses the "Details…" button. That seems like a lot of work, though.

sketchflow navigatetoscreenaction popup

I am using SketchFlow for a prototype. Right now when the user clicks certain 'links' a trigger is excuted which calls navigatetoscreenaction and I supply the target screen. The problem is instead of going to this screen and leaving my main window, I want my target screen to popup into a modal dialog. Can you accomplish this with Sketchflow?
Yes, but you might have to code it up yourself. If you truly want a dialog you will have to do it in the event handler for the item you are clicking. You would do it just like any other dialog on the platform you are using.
If you just want to simulate it, you could make the screen into a component screen and use visual states to hide/show it. Made it hidden in the base state, and create a show state that you trigger with a behavior.
yes you sure can, with a component screen. Right click on your source screen in the sketchflow map and there it is.

Resources