.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

MdiChildActivate Form Closing Event

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :Windows Application
MdiChildActivate Event Occurs when a MDI child form is activated or closed within an MDI application.Is there anyway that we can find that the event is raised by the child form closing event?

View Complete Post

More Related Resource Links

Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


OK button click on Windows dialogue form not triggering click event

I have created an Add-In for Outlook 2003 in Visual Studio 2005. When a new message is sent and a toggle button is selected, a form that I have created will be displayed as a dialogue box, where further information can be entered. Once this information has been entered you can click the OK button and the message is sent. If you were to click the OK button with invalid data in the form, there would be a message box with an error message. This all works perfectly on my development machine but when I have packaged the Add-In and installed it on other machines it does not work. Clicking on the OK button does nothing, there is not even an error message. All the prerequsits are successfully installed and this is the only part of the Add-In that does not work. All help greatly appreciated. Thanks Nick

Windows Keyup event is routed to next form even if the current form is closed

In a form (say FormA) i have 2 events "Keyup" for the form and button_click event for the button. I call FormA from the main form with a showDialog, after this i call another form (say FormB), it also has the 2 events. In both the form the button_click event has the logic to close the form (this.close()). Now when the FormA is opened the focus is on button, if the user presses "enter" button the button_click event is called which closes the form, the logic returns to the main form and the next line i.e. to open the FormB is executed. Now here is the wierd part, in FormB because there is a KeyUp event handler; just after instantiation of the form directly this event handler is called. I guess this is being routed from FormA. Shouldnt the FormA's keyup event be closed as soon as the form is closed?

opening a web browser without opening form on windows form load event

Hello All, I have a main frame which has a display button. after clicking on display button I usually open a windows forms. Now I have a requirement to open a web page after clicking on display button. I should not show windows form to the user. for that I had written following code in the Form_int (override) event of windows form. System.Diagnostics.Process.Start(http://www.google.com); and I commented out ShowDisplay(); code.  Everything looks good till now and when I run the project and clicked on display button web browser has been opened, but if I click again another web browser is being opening. but I don't want another browser to be opened. can anybody please help me in that. Thanks in advance.

event for minimized form

hi i need an event that fires when minimized form in taskbar is clicked. Any help would be greatly appreciated.

KeyDown event on a Form is not firing for STX and/or ETX

I'm using a wireless barcode reader that's inputting data using HID. I've configured it to wrap the output between STX and ETX (0x02, 0x03), however, i never get any KeyDown event generated when those keys are sent from the device, the barcode keys are sent just fine but not STX and ETX.

Web form page load event


I have  Web page that uses LinkButton control inside Template Fields of Gridview.

I am trying to work on LinkButton Click event and trying to preserve the Value of LinkButton that user click, and based on that value, i want to refresh tha page data.

I used CommandName and CommandArgument property of Linkbutton, but i can use that property only in GridView_RowCommand method by checking e.CommandName expression. But the problem with that Gridview_RowCommand event fire after all other page_load activity. So the value never used in the page_load event to refresh the data in all other control.

I also tried to use OnClick Method, Session variable and Hidden variable. but when i run Response.Redirect method from Gridview_RowCommand, it clear all the Session and Hidden variable values. also tried (Response.Redirect(,false)) method but never got success.

Any suggestion will be appricated in advance.

how can i load a window1.xaml form from click event fuction of a button

how can i load a window1.xaml form from click event fuction of a button

Form inheritance and key press event



I've created a basic form BasicForm which all other forms in my application will inherit. In this basic form I'd like to handle some generic stuff which are common for all of the forms.  An example => key press event, for when user would press ESC key in any of my forms it would automatically close that form. This is how I tried to do it: 


public ref class BasicForm : public System::Windows::Forms::Form

 	protected: virtual void OnKeyPress(KeyPressEventArgs^ e) override
 		if (e->KeyChar == 0x1b ) // ESC

Closing a WPF form from another thread?? The calling thread cannot access this object because a diff


I have a WPF form with a Close buttom which just does


I also have a public method in this WPF form which goes like this

public void doClose()

doClose() is supposed to be called by other classes but I keep getting this runtime error when this method is called:

The calling thread cannot access this object because a different thread owns it.

Please tell me how to solve it.



1 + 1 = 3

recurrence event functionality in custom new form



i am creating custom form for creating new Event( of Event List). How can i include reccurence event UI and functionlaity in my custom  form?


Thanks and Regards,


Form maximize/minimize click event


I need to know when the maximize or minimize button has been clicked. I am saving the window state so it is in the same state as when the user closed the app. Anyone know how to do this?




Hide window in Deactivated event only if not Closing



I'm trying to hide my application window if user clicks somewhere outside application.

But sometimes (not always) user gets "Cannot set Visibility or call Show, ShowDialog, Close, or Hide while window is closing" when trying to Close the app window.

private void Window_Deactivated(object sender, EventArgs e)
   //if not closing...

I need somehow define whether user is trying to close the window before hide it. I tried to subscribe Window_Closing event but is raised after deactivated.

Please, advise.

Thanks, Alexey. Develop with pleasure!

file attachment control on infopath 2010 browser form, validating event not fired


If preview within InfoPath 2010, the validating event is fired. But After deploying the form to SharePoint 2010, the validating event does not fire.

Any ideas?


Blog: http://convergingpoint.blogspot.com/

The paint event on form appears to be hijacking the thread in another form.


Hardware: GigaByte Motherboard with i5 4 core Processor

Development Software: VS 2008 Pro

Operating System: Windows 7 Pro

I have an application that displays five forms at start up.

  1. [Start ] about 300 PX wide opens all other forms on start.
  2. [Cluster ] has  a ListView, TelNet connection and a reference to a SerialPort Component on [Radio ].  This form has a mouse down event that populates and opens a dialog, [NewLogEntry ], which on load populates it's controls with data sent from [Cluster ].  [Cluster ] also writes data to [Radio ].SerialPort to set devices on [Radio ].  [NewLogEntry ] sends data to the data store and populates the ListView object on [Log ] before it closes.  [NewLogEntry ] also has a button containing the calculated bearing between the application users location and another point on the Earth.  Clicking that button writes the bearing to the reference that points to [Rotor ].SerialPort.  Upon closing [NewLogEntry ] sends it's data to the data store
  3. [Radio ] has many Buttons and a few GroupBoxes with a SerialPort Component connected to

ItemAdded Event not always returning SharePoint field information when InfoPath form submitted


 (SharePoint 2007)

I am struggling with an issue related to InfoPath and use of the ItemAdded event handler.  I have created an InfoPath form that contains several fields that are being published to SharePoint fields in a Forms Library.  When I submit a new form, the SharePoint data is being correctly updated.  ian see it in the list.  However, I am trying to write an ItemAdded event handler that performs specific logic based on the value of one of the InfoPath/SharePoint fields for the form being added to the library.  The logic appears to work correctly the first time through.  I can sucessfully read the value from the field and then execute my logic.  However, subsequent submissions appear to not be able to read the values.  It is like they don't exist or are null.  I am thinking that it has something to do with threading but I cannot find a work around for this problem.  The interesting thing is that the same exact logic works correctly when the ItemAdded event handler is tied to a standard Document Library.  Any word documents that are being added always read the values correctly. 


Does anybody know what might be causing this or a possible way around this issue? 



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend