JS: Close event -
I have this script that suppose to be the alert pop up when you close the page but when I refresh the page 'F5' the alert pop up. What's wrong w/ this? Is there another way to do this? Just pop up an alert when you try to close the page?
Code:
<html>
<head>
<title>sample</title></head>
<body onbeforeunload="alert('closing');">
</body>
</html>
Close or Unload -
Which event is the best place to put code that should be run when the user closes a form? I have code in the Unload event of a form that is supposed to send an email and delete all data from a table. It's always worked for two users, but not for a new user. I'm not sure what she did di
Cancel form close event -
Guys,
Is it possible to cancel the Form close from within the form_closing event if certain criteria are not met ? I'm guessing that doing this on the closing event is probably too late ?
I need to stop the users from hitting the close X on the form in certain cases.
Cheers
B
winsock events -
I can't remember.. but i don't hav ethe time to test..
if you
winsock.close
will that trigger the winsock_close EVENT?
say it was a server who called the event.. etc.
AND.. if an error occurs, does it also call that event? or in the error sub, do you have to put winsock.clos
UnLoad event -
How does one trap the OnUnload event of the window object. When I close a window I would like to trap the Unload event. I tried calling it in the BODY tag as shown below.
<BODY OnUnLoad="UnLoader">
However in this case the unload event is invoked when I click on the R
OnUnload event -
How does one trap the OnUnload event of the window object. When I close a window I would like to trap the Unload event. I tried calling it in the BODY tag as shown below.
<BODY OnUnLoad="UnLoader">
However in this case the unload event is invoked when I click on the R
Trappinng a Key_Press event -
Hi,
I need to trap the key_Press event for a particular key,which in turn when detected,will fire an event.
Let's go ahead with a simple example.
Suppose,When a form is being displayed,by pressing Esc key,I need to close the application(Me.Close()).
Help in the form of code
Form Close -
My application shows another form (FormB) with "Modal " by selecting a menu option in main form (FormA).
In Form B, is that any event (preferably single event) that can catch the following sitatuion:
- form close by pressing a command button with FormB.unload;
- form clo
Quick Winsock question -
Hi
I have developed a winsock application.
Everything is working fine except for client disconnections.
If a client program is closed, the Winsock Close event occurs on the server program.
However, if windows crashes, or the client computer is just turned off, the close e
How to close dialog forms during load event -
During load event of dialog forms you can not close it using me.close or me.dialogresult=dialogresult.cancel or calling any closing event. How you would accomplish this?
Detecting disconnection from winsock -
I need to know how to detect the event where a client closes. I have a chat server and if the client suddenly closes the program or restarts, there is no way to trigger any event to clear their names from a combo list.
I can't even get it to work if they close the program correctly
[2005] Ignoring FormClosing event -
I have an app with a single form. When the form loads it first does some checks and, if one of those checks fails, pops up a critical error then closes the app when the user clicks OK.
Now, the form also has a Closing event for when the user closes the app themselves Of course,
How can I close an application and receive QueryUnload event -
I like to close application via an API call.
I think it is possible using the PostMessage API, but all examples use WM_Close, for example:
RetVal = PostMessage(winHwnd, WM_CLOSE, 0&, 0&)
This always results in immediatly closing the application without the form
How to get Window Close Event in VB6 App -
Guys,
I'm sorry, this has been asked a good few times I am sure, just anyone help out with the API I need to hook to a window and listen for the close event ?
My app is shelling INternet Explorer windows and I want to do something if one closes.
Thanks
Chubby.
An MS Access VBScript question -
Hi,
I am doing some validiation in the close event of my form, and would like to Cancel the event if a field is null, i.e the form doesnt close but it instead pops up a message box saying why it hasnt closed.
How can I do this?
closing a form at Form_Load -
Umm I'm getting confused. I have to close a form at Form_Load event, but it doesnt work when I put the code in the load event
I'm using Me.Close () .....
And yes, dont tell me that it doesnt make sense to close a form when it's loading. It's in a If statement and it's suppose to cl
getting excel closing event ... -
i hv got an excel object with events in my normal vb application ..
i just want to know when i close excel from File - Close Menu or Alt+F4 or clicking Close cross button of application , i should know that excel is going to close so that i can release my Excel object in my applicati
Get the close event of a form -
Hi
Im trying to put some code,,when a form is close,,but i try with the unload and with the desactivate method,,but it doesnt enter in these methods..but i absolutly need to put code when the window is close,,,is there a way to cath this event. My form is a part of a project thats wh
Is there a form close or try to close event -
what can I use to "show do you want to save the file" msgbox
is there a on form close event or something, I couldnt find anything
If the form's close buttone is closed it should ask if we want to save the file or not, if the user want to save the file the save function shou
Help Handling Close Button -
I need to simply make it so that when the user hits the X to close the form, It minimizes, and doesn't close. If I put this in the Unload event it will minimize, but I will still close. Thanks for any help!
Form's "x" (close) event -
I am new to VB and have run across a small problem with how a user can exit my application. The problem occurs when the user chooses to close the program by using the windows close button instead of using one of my coded exit procedures (which clean up all objects, like recordset &
Raise Event to Tell Form Was Closed -
Hi All,
I may be going about this the wrong way but...
I have loaded a form as a modless form from one of my classes. I would like to be able to signal the class to let it know that the form was closed and that it is ok to close the class.
I was thinking about using an event
Picking up the close form event -
If someone selects the little cross on the form to close it how can you capture this event?
How to trap window close event of Browser in IE -
I want to trap the event of the Window close of the Browser using Java Script so that I can call the function on that event.
I am writing a Client Server application using Java Script and Java Servlets. I am giving client a database connection when the user correctly logins to the ser
[2005] FormClosing event -
Why when I close a form does the formClosing event cause the selectedIndexChanged event of a comboBox also to fire. How can I stop that from happening?
is there a form-after-load event in VB -
What I want to do is:
1) Show the form;
2) Check something, if false, then just show a msgbox, then close form
if I do this in form_load event, the form does not show up when msgbox shows up. After I close msgbox, the form shows up very quick then close. I do not want see the form
On Close Up of Combo -
I know in Sheridan's Combo box there was a close up event. So, after the user made their selection and the drop down list disappeared I could fire off another event without waiting for the user to tab to the next field.
I'm trying populate a 2nd combo after the user selects an item
Problem with Events -
Hey all, i am using a small form containing a listbox.
Now what I want to do is if the user double clicks an Item in the listbox, some code will happen and then the form closes.
So I added the doubleClick Event and tried
this.close();
Calling the close method I guess cal
Cannot close my program for shutdown -
I have a program that uses the X(close) button in the right hand corner of the Form to make the Form invisible. I only want the program to exit from the Close event if windows is shutting down.
To check if windows is shutting down I override WndProc and check for the WM_ENDSESSION
Help on close event -
Hi,
I have an MDI application written in VB.NET where the child form allows user to do some input works.
In the Closing event of the child form, I will check the dataset to see if there are unsaved works, and prompt out a message, then set e.Cancel to True.
This works fine, ho
windows close ("X") event name -
hello all.
this is something i have wondered for awhile.
what is the event name of the windows ("X") button on the windows control bar.
the trouble is that i am not getting my app to close, and i have determined that my forms are loading clean and nothing is being le
Closing event doesn't get called when the form is hidden. -
Hi Folks,
Need ur help.
I am developing a desktop application using VB.Net. In one of functionalities I am hiding a form and keep one popup form open. Depending on the result from the popup I want to close the popup form and show or close the hidden form. But the problem is I hav
Capture minimize event -
What is the best way to respond to the form being minimized? I want to make it .Hide() itself when it minimizes to it gives the effect of minimizing to the system try. It is easy to capture the Close event and do this, but I want the form to close when it is closed and go to the sys tr
Cancel Close Problem -
Okay my problem is this I want stop the user from closing the child form of my problem if there is only one open, but if I set the cancel event to true in the onclosing event it will not allow me to close the program. My first thought was the set a boolean value to check to see if the
Implementing a Close event for custom class -
How can I implement a Close event for my custom class?
I need to save some settings when the class closes but since its not a form class it does not have a closing event.
I'm using the My.Settings feature to save settings.
I'm thinking there is a way to make sure the settings are sa
API & Unloading MDI forms -
Anybody for a challenge? This one has beat me.
Ive got a VB6 project with a HookWindow to capture windows events for an MDI form. Using the X to close the form in Windows98, tool tip 'Close' appears just before the MDI form closes.
Windows raises an event to erase the backgrou
Cancel closing of a form. -
Hello,
I'm trying to trap altered state of records in the OnClosing event of a form to see if they want to save changes before they close the form.
I want the options to be Yes/No/Cancel so that Yes=save changes, No=ignore changes and close the form, Cancel=don't close just yet.
[2008] Closing program while in form load event -
I have a program that checks for two directories and two files to exist on the Form Load Event. If something is missing I want ot have my messagebox displayed and then the porgram to close.
I tried using the Me.Close, but since the form has not even been loaded it gives me an error
Disable ALT+F4 key in a form. -
Hello,
I have the solution for disable the Alt+F4 key, but when second time I press Alt+F4 key the application close. I want to avoid this problem.As well as it should be applicable for full screen window. My code is as follows:
function disable()
{
var key1 = window.event.k
Catching the Close Button -
I have seen the event for when a user click the close button in the right hand part of the window on a visual basic program, and thus, allowing you to override the close. Does anyone have this code for me?
Excel Worksheet Problems -
I have seen a lot of code on how to open up an Excel worksheet with a click event on a form, but how do I save the worksheet then close Excel by exiting the Excel application through Excel and not another click event on my form.
I have a form, with a command button, that when clicke