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

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

Close current form?

Posted By:      Posted Date: October 23, 2010    Points: 0   Category :WPF




I'm using the Fluent.dll control, and I want to activate the backstage view from another form, so I would usually do it with this code:



Dim objWin As New MainWindow()
objWin.MainRibbon.IsBackstageOpen = True


So basically I want to close the form that's open, and activate backstage in the other. For some reason though, this code doesn't work?!


Help! :)


View Complete Post

More Related Resource Links

click a button to print current window form

how can i click a button to print current window form? i don't know how to set and define something? anyone give me example for my reference   thanks.

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?

InfoPath form web part stops the close on submit

I have successfully published HTML browser enabled InfoPath 2010 forms to form libraries in SharePoint 2010. Users can navigate to the libraries and click new docuiment and fill out and submit forms, and the behavior of submit is as programmed in the form namely I have a concat rule for form name and chose action after submit to close the form with a success message. The problem I am seeing is a little abstract so stay with me while I explain. I'm hosting a number links to web part pages with the infopath web part on them. I use a links web part to aggrigate about 16 forms links on a single page. Users can successfully click on a link, are migrated to the web part page that has the form displayed in the infopath web part and all is well till they click the submit (on the ribbon, or custom button or whatever) The form does successfully get saved into the form library, but the form does not close. I need to make this process very simple for users without any training expended on the process. I'd like to shift focus to the previous web page, or close the form or something dramatic visually to show the user that they have completed the form fill out, and allow them to fill another form. Codebehind examples gratefully accepted! /Robin    

Custom Edit form - close modal dialog and navigate to page

Hi, I created one custom edit form for my document library, replaced default save and cancel buttons with input buttons and added the form action to them. Then I set my page as default edit form. When I click edit button, my custom form opens in modal pop up. When I try to save the item by clicking new save button, item gets saved but pop remains as it is. Now, I want the modal pop up to get closed and navigate to page other than the parent page with some parameters after I click save button. How can I achieve this? Thanks!!

How to close a Form...

Hi all, i recently started C++.NET(CLR) and i cant seem to get Form1 to close after Form2 is loaded... after clicking ok button on Form1, Form2 is loaded properly but then i want Form1 to go away.. i tried almost everything, i included the header file of Form1 into Form2 but that just gave me around 6 errors saying that the instance i created of Form2 in Form1 was undeclared, then i removed that and just tried creating an instance of Form1 in Form2 load method but that also just gave errors... Help plz =/

how to close a form using Jquery

(1) how to Close a Parent Form2 how to close a child form(iframe)

how to close a form,subform,iframe and everthing using jquery


how to close a form,subform,iframe and everthing using jquery

URL of current form (InfoPath Forms Services)


I need to programmatically determine the URL of the current form, preferably without adding new dlls to the form template and increasing the trust level.

The XmlLocation query string parameter looks perfect for this, but when I try to retrieve it using 

String strSaveLocation = String.Empty;
e.InputParameters.TryGetValue("XmlLocation", out strSaveLocation)

it is empty.

In fact, outputting all the InputParameters shows that for my existing (i.e. already submitted and saved to a library) form, the XmlLocation parameter is not present (even though I see it in the querystring). Instead, there's SaveLocation (even though it's not in the querystring). The value of SaveLocation isn't dynamic - it points to the root folder even when my form is in a subfodler. I want a value that will work even if the form gets moved to a different subfolder.




how to close a parent form


how to close a parent form

filling current user name in people picker field when loading form using javascript


Hello guys,

I am looking is there any way to fill the current user's name in people picker field in newform.aspx using javascript?

If you anything, please let me know 


close popup form and open again

when i click a button, then prompt another form and then i click close button at the upper right corner of the form
the popup form is closed
then i click a button again, then prompt a popup form again
but now when is popup form is prompt at second time,it always trigger form_closing event,why?
how to prevent it?

Programatically close web enabled form after submit


Hi all

I have an InfoPath 2007 form, which is web enabled and deployed to Forms Server 2007.

On the form I have a button. What I want to happen when the button is pressed is this:

1. My custom code behind should be executed. The custom code calls an external aseembly (common to ALL my InfoPath forms) which has a method that includes a dataconnection.Execute which will submit the form.

2. Close the form IF the submit went well.

Currently, I have a code behind and a rule on the button. What I am trying to get working is that the code behind sets a status flag on the form to "Success" and then executes the data connection. If an exception is thrown, I set the status flag to something else ("Failed") and rethrow the exception. In the rule of the button I then check this status field in the condition of the rule and if it is set to Success I close the form. What happens is, that the form is not closed uppon succesfully execution of the data connection. I am not sure in what order the code is run; Is the rule fired first or is the .NET code behind? It appears that the .NET code IS fired... and if the form was closed in the rule, then I wouldn't expect that to happen. So that means the rule is fired last. On the other hand the value set in one of the fields is not present upon validation of the condition of the rule, so tha

maximize, minimize and close buttons on the form should be invisible



I do not want to display the maximize, minimize and close buttons on the form.

How can i do this?

Are there any properties to make them invisible on the form?



how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

Auto Populate current date & time in the New form



I have requirement where I want the current date and time in the newform opened by users. I can get the current date with Today's Date option. But not able to find the time option. Is there a possibility with SPD. Tried using button option to activate a formula to the textbox value so the user can jus click the button to get the current time and date. but facing problem in that.  Kindly advice.



How would I Close base Form when Calling a New Form

hi all, I have a login form and a Main Form. I want to Show Main Form after verifying user name and password. My written code is below (c# environment): this.Hide(); objMain.ShowDialog(); this.Close(); this.Dispose(); it's work fine. problem is when MainForm is activated, Login form still running in the memory (hidden). But i don't want so. I want free the memory by closing Login Form. If I use Show Method so total project's END. thing is happening here that, ShowDialog() Method hold the command and that's why other command are not executed. after closing Main Form other 2 line of code executed. I want to Close base Form before or after activate Main Form. Any help will highly appreciated. Thanks in Advance.
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