.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

click a button to print current window form

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :Windows Application
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.

View Complete Post

More Related Resource Links

Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page


how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services


Thanks in advance

Infopath 2007 print view in browser enabled form with Print button


Hi i create a  print view brower enabled form in Infopath 2007 with header and footer. In Infopath works fine. Margin was ok, header and footter to. But then i try to print this browser the margin, header and footer it changes to default setting of browser ? I try also create a print button in form with VS 2008 code, but method :

this.print(); not working.

It is possible to print the "print view" in browser as the same like in Infopath 2007? Does anyone have the code how to create a print button in C# on browser enabled form?

Infopath form using Visual Studio - How to bind repeating table on submit button click ?


Hello friends,

   I have created infopath form using Visual Studio 2008

Form have 3 dropdowns and one repeating table which is bound by Datasource ( List from sharepoint ).

whenever i select appropritae values from drop down, Repeating table gets bound as datasource for dropdown and repeating table are same.

I have done conditional formating for repeating table using repeating table properties.


My Question:


Now i included one submit button and i want when i click submit button it will check DropDown Values and if appropriate record matching these values found it will fill repeating table

How i achive this ? as i dont find how to bind repeating table on submit button.

Please help if anyone have answer.


Thanks and Regards,


Kapil Bhosale.




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

Does the ReportViewer control print button work inside of a modal MSIE window?

I am getting the following two error messages when using the new ReportViewer v10 control after pressing the toolbar print button. I am only seeing this error inside of a modal popup window in MSIE. The print button in a normal popup window doesn't have this error. An error occurred trying to get the current window Error: Could not complete the operation due to error 8007f305. If anyone knows of a quick fix, please let me know. Thank you. VS2010, MSIE 8, SQL Server 2008.

Print Button +code in form

Using sharepoint 2010 and designed a simple form. How can I add the Print functionality to the ribbon from standard SP2010 NOT using Infopath? thx

How to redirect Infopath form programmatically on button click


I am having an issue with infoPath Forms and C#, 
I have a 1st form open to the user, and when he click a button it opens a 2nd form.

Sounds pretty easy, but I have tried many ways and still error.
(environment is InfoPath Forms 2007 in Sharepoint and code: C#)

this is what I have:
- form1 . a text field where I enter the URL of form2
            . a button with code below

The issue is that if I type the URL of form2 
 in the text field and press the button I get this error
"Critical Error : An error occurred submitting this form to the Web server. The form will now be closed."

But instead of the URL of form2.xsn I type http://www.google.com/ they it works (w

Open another Form from my Main form using a button click


Hi All


I have seen this question asked and answered several times but it doesn't seem to be the question. I have.


I have just created a new project I renamed form1 to FrmMain and then I created a new form by clicking add new form and I named it Report


I then went to my FrmMain and dropped a button on there from the toobox. I now need to open Report.cs when I click the button.


I have tried               Report Form2 = new Report();



But all that does it open a new FORM and its not my Report Form. It also just keeps opening new forms every time I click the button. My thought is that the user will enter a ID then click the button then the report form will open and I will then create a query to populate a data gride or view using the ID form the text box on FrmMain.


Please help.... I am new to this so shoot it straight as if this was your first forms application that you created.



how to open window in new page on button click


hi all,

Here's my code

        If rdvalue = "Dept" And ddldeptr.SelectedValue <> "" Then
            Button1.PostBackUrl = "~\Reports\Hrmis\CrvGpDept.aspx?fromd=" & txtfrom.Text & " &tod=" & txtto.Text & "&dep=" & ddldeptr.SelectedValue & ""
        ElseIf rdvalue = "Sect" And ddlsectr.SelectedValue <> "" Then
            Button1.PostBackUrl = "~\Reports\Hrmis\CvGpSect.aspx?fromd=" & txtfrom.Text & " &tod=" & txtto.Text & "&sec=" & ddlsectr.SelectedValue & ""
        ElseIf rdvalue = "Desig" And ddldesigr.SelectedValue <> "" Then
            Button1.PostBackUrl = "~\Reports\Hrmis\CrvGpdesig.aspx?fromd=" & txtfrom.Text & " &tod=" & txtto.Text & "&desi=" & designation & ""
        ElseIf rdvalue = "Emp" And txtempidr.Text <> "" Then
            Button1.PostBackUrl = "~\Reports\Hrmis\CrvGpemp.aspx?fromd=" & txtfrom.Text & " &tod=" & txtto.Text & "&emp=" & empid & ""
            Button1.PostBackUrl = "~\Reports\Hrmis\CrvGpall.aspx

click a button to pop up new window to pass a value; is working on second click onwards


Hi all,


i am facing a problem to make a button onclick to pop up a new window with pass a value. it only working on second click on onwards.

i check the checkbox from a table then pass the ID for each data to another page.

below is my coding: hope anyone can help me. this is i add in button click; the PIID is a value i want to pass


 Protected Sub btn_download_in_excel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_download_in_excel.Click


        Dim keyID As String = ""
        Dim CheckedItems As SortedList = ViewState("CheckedItems")
        Dim ChkBxIndex As String = ""
        Dim strPsId As String = ""
        Dim PIID As String = ""
        Dim rows() As DataRow

        Dim CheckedItemsKeys As ICollection = CheckedItems.Keys
        Dim keys As IEnumerator = CheckedItemsKeys.GetEnumerator

        While keys.MoveNext
            If Not IsNothing(CheckedItems) Then
                ChkBxIndex = keys.Current
                keyID = ChkBxIndex

                rows = pLookupDataSet.Tables("CCL_TB_PART").Select("PIID = " & Cmn.QStr(keyID))

                If String.IsNullOrEmpty(PIID) Then
                    PIID = keyID

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

How to change a text color in window form button!



I got an Export button in the form. I like the button text color that change from original black to white when I press it. I can change the background color of the button, but I am not sure how to change the Export text color to white. Please help. Thanks in advance.

Merge SQL to Excel--Need .Net button to open on fly and have current SQL data!


           Hello all,
I do not know if this is the proper place to ask this, but my question is...
I have a SQL DB and I want to convert it to Excel Sheet (I did this using the wizard)!
In my aspx page I have a button.  So when I press this button I want the Excel sheet to open!  But I need the Excel sheet to show me the up to date information that is in the SQL DB.  

Button click in master page use in other pages I have to click twice. Why?


In my masterpage I have a menu with buttons. I want the buttons to do something after click. It works but I have to click twice on the button, why? What do I have to do to just to click once?

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