closing

java swing close window without exiting app

I have a little frame where I ask user & password. This frame will be opened clicking over a button in a main window. Then I have two buttons: ok and cancel. When I click on "cancel" button, I need to close this frame without exiting the app. How can I do that? ...

closing a dialog after a delay

After calling DoModal() on a dialog, and calling a delay function. how do you close the dialog. m_dlg.DoModal(); Sleep(1000); . . . ...

Perf problem with a stored proc - closing a connection too slow.

I have previously asked a question about a stored proc that was executing too slowly on a sql server box, however, if I ran the sproc in Query Analyzer, it would return under one second. The client is a .NET 1.1 winforms app. I was able to VNC into the user's box and, of course, they did not have SQL tools installed, so I cranked up ...

How to prevent browser from closing while running an XBAP?

We need to prevent the browser from closing (hitting X) in our XBAP application if the user has edited any data. We are checking for this in the Closing event of our Page/Window, doing e.Cancel, and that does fire correctly, however it does not prevent the browser from closing. This does work when closing a tab, but not when closing th...

XSLT self-closing tags issue

Hi, I am using xslt to transform an xml file to html. The .net xslt engine keeps serving me self-closing tags for empty tags. Example: <div class="test"></div> becomes <div class="test" /> The former is valid html, while the latter is illegal html and renders badly. My question is : How do I tell the xslt engine (XslCompiledTrans...

Can I put commands after Form.Close() ?

In C#, Suppose I am in a form, and I pressed a button I made to close it. this.Close(); some_action(); //can I do this?? can I perform another action after I closed the form or does the thread die and everything after that is lost? ...

Closing WCF connection

We are using WCF service on the client side we are planning to explicitly close the connection It seems there are more then one way of closing Sample1: In the finally block of the WCF service consumption use if (client.State == CommunicationState.Faulted) { client.Abort(); } client.Close(); Since if the service is in fault state...

C# - Detect reason for form closing

How can I detect how a windows form is being closed? For example, how do I find out whether the user has clicked on a button which closes the form or if the user clicks on the "X" in the upper-right? Thank you. Update: Forgot to mention that the button calls the Application.Exit() method. ...

WCF duplex channel gets closed when using callbacks

My WCF service uses netTcpBinding, and has a callback object. I need to service multiple concurrent clients, and mantain sessions, so the service is decorated with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple] To avoid thread deadlocks, the callback class is decorated...

C# : OnClosing takes a while, how can I show a dialog with a marquee progressbar ?

I have to do quite some cleanup in my OnClosing handler, which makes it seem like my app is hanging. How can I show a small dialog with a marquee-style progressbar so users will at least know it's still 'working' ? Basicly I want to start the dialog, proceed with all my shutdown-procedures and when that's done, close the progress-dialo...

Check if user closed the page in PHP?

I made a chat using PHP and JavaScript chat and there is a disconnect button which removes user from the chat removing him from user list first. But if the user closes browser then he will remain in the user list. How do I check if he left? This must be done without putting any handles on page closing in JS because if user kills the bro...

Close calls take forever using Cocoa's asynchronous IO?

I am writing a single threaded Cocoa app and am attempting to use the NSNotificationCenter utility methodology (as that seems to be how things are done in cocoa) to do non-blocking IO. Everything seems to work fine except for when the file handle is closed. It eventually notifies me, but it takes forever. Can anyone explain why this w...

Any difference in xhtml between <img .... /> and <img ...></img> at all?

same as title, I'm pretty sure it has no difference, but just to be on the safe side with standard compliance. ...

Which should I close first, the PreparedStatement or the Connection?

When using a PreparedStatement in JDBC, should I close the PreparedStatement first or the Connection first? I just saw a code sample in which the Connection is closed first, but it seems to me more logical to close the PreparedStatement first. Is there a standard, accepted way to do this? Does it matter? Does closing the Connection also...

javascript and thickbox

Hi, I have a thickbox appearing and have created a button which points to a new URL. I want it to work in the following way: 1. Click the button 2. Close the thickbox 3. Set parent window to new url. I have succeeded in closing the thickbox but cannot get it to open the new url. The code I'm using is as follows: a onclick="javascript...

Trouble closing img tags in Javascript – using strict xhtml DTD

Hi I am using a Javascript called Niceforms.js which makes HTML forms looks pretty. It works fine under the xHTML Transitional Doctype, but I need to build my site using Strict xHTML. It has a few problems rendering under Strict and I'm fairly sure it's because it isn't putting the trailing slash in a few <img> elements so that they ...

PHP omits a return.

Hi, when a carriage return follows a closing php tag, php doesn't print it. How can I change this? Thanks a lot ...

Javascript register window/tab closing event before window/tab close

This has / may have been asked before, but, as far as I remember, the question was not satisfactory answered at that time ^^ How can I register a window or tab closing event with Javascript? I have tried body.onclose and body.onunload, and dozens others whose names I made up myself and thought they might possibly exist, but none of it w...

Method may fail to close stream on exception

I get the critical error with finbugs The method creates an IO stream object, does not assign it to any fields, pass it to other methods, or return it, and does not appear to close it on all possible exception paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensu...

How to know user has clicked "X" or the "Close" button?

in MSDN I found CloseReason.UserCloseing to know that the user had decided to close the form but I guess it is the same for both clicking the X button or clicking the close button. so How can I differentiate between these two in my code? Thanks all. ...