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

Top 5 Contributors of the Month
Post New Web Links

Printing a active mdi child form

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :Windows Application
I am making a Windows application. I have written the code for printing the active mdi child using PrintForm in C#. The problem is that my forms are big so they do not come fully on the screen i.e. they are scrollable. Now when I print the form, I do get the full form. I also used the scrollable but its no use.
The code is:

 if (this.ActiveMdiChild == null)
            printForm1.Form = this.ActiveMdiChild;
            printForm1.PrintAction = System.Drawing.Printing.PrintAction.PrintToPrinter;
            printForm1.Print(this, PrintForm.PrintOption.Scrollable);

Can someone help me and tell me how to get the full form along with the data. Please don't tell to capture the screenshot as the form is scrollable.

Thanks in advance.

View Complete Post

More Related Resource Links

While Printing an Infopath Form it Prints lot of Blank Spaces Before RichText Field


I had an infopath form with few rich text field. When i copy some content from somewhere and paste in the richtext Box then while Printing the form I get Lot of Blank Spaces Infront of the rich text box.

I tried creating teh print view too but still i get bunch of empty pages printed before by richtext box control.

Is there a way we can remove those blank spaces.....

I am not able to find out what is going wrong here....

Printing list item as a infopath form

The infopath turn off the print option and Idont know how to activate it. It is a list item that desiend with the infopath desiener and have some data conections to other listes at the same site thanks Aharon

Delphi Win32 MDI Parent with C# Windows Forms child form

I have created an assembly containing a form that i want created as a MDI child form in a Delphi Win32 application's MDI parent control. I can create the .NET form fine from my Delphi code. I can even use the Delphi window handle to let my .NET form be a child in the Win32 application by using the SetParent API. However minimizing the child form makes it disappear (instead of the regular minimize action for MDI children), and it also doesn't cause the MDI container to get scroll bars when you drag the child form under the edge of the MDI container. I have the feeling that the child form is not yet correctly aware that it is a MDI child. For instance, its MdiParent property is null. And i read somewhere that i might need to call some more Win32 API"s to hook everything up correctly. I can't, however, for the life of me not find which ones to call, and where to do it. Is there anyone here that is well versed in hooking up managed Windows Forms with native Win32 applications that can lend a helping hand?

accessing form view binded control from child control

I am using a form view control which has two binded textbox. Now at this level it works fine and the textboxes show the values from database. But when i insert a panel inside the form view and move these two textboxes inside the panel, they dont show any values. What could be the reason for this? Thanks!

Need help on Main Form Open Child Form

Hi, I've 2 form which is frmA and frmB. frmA have a 1 button and 1 label named Button A and Label1. frmB have a 1 button named Button B. frmA is a Main Form. frmB is a Child Form for Form A. My objective is when frmB is closed, then Label1 in frmA showing the value. My code in frmA as follow public partial class frmA : Form { public frmA() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { frmB oFrm=new frmB(this); oFrm.ShowDialog(); } public void PerformRefresh() { label1.Text = DateTime.Now.ToLongDateString(); } } My code in frmB as follow, public partial class frmB : Form { frmA _owner; public frmB() { InitializeComponent(); } public frmB(frmA owner) { _owner = owner; this.FormClosed+=new FormClosedEventHandler(frmB_FormClosed); } private void frmB_FormClosed(object sender, FormClosedEventArgs e) { _owner.PerformRefresh(); } } At this level, i can call function in frmA from frmB after closed event. My problem is when Button A in frmA clicked, frmB not showing like frmB as per design. It's display a windows without Button B. I'm stuck. Really need help

How do I center a form for printing using printform?


I am developing an application in VB 2010 Express and want to center the form on a landscape page.

To set landscape I am using:

PrintForm1.PrinterSettings.DefaultPageSettings.Landscape = True

Could also set the left margin in a similar way but is there a property that automatically centers?


Accessing Active Directory's User Profile Information in InfoPath Form



I want the User Profile information in InfoPath Form from active directory and I want complete information of currently logged in user which include:

User Name, First Name, Last Name, Email Address, Designation, Company, Manager Name and everything which is in the profile of user in Active Directory. Please help me in getting this.


M Kamran Rafi

stop flickering when form child appear like normal window



I have created an application with a mdiParent and some mdichilds that when are opened they the forms are set like normal window and FormBorderStyle has value 'None'. When I call any child that is set like this, the application seems to flicker (it seems that for a very short time the child appear like a normal window wit the title bar and minimize, maximize and close button) and very quick it's ok (the title bar is disapear and the child take his place on the mdiParent). But I want to stop this flickering it is very annoying.

Can somebody tell me how can I do that? I mention that I have created this application in dot.net

Thank you in advance

Child Form

VMS.Forms.FormTest obj = new FormTest();
      obj.MdiParent = this;

Child Form not display Please suggest how can I fix it?

Form page considerations (Printing)


I'm creating a form to plot musical notes and tabs for the guitar. I'm to the point now where I have most of my code to accomplish what I what it to do. Now I'm adding a print option. Each Time I add a function I trend to have to redo some of the older parts of my form witch I assume I will here as well. What I have is two Shape Containers that I click on to create my notes and now I would like to print my project. How Big should I make my Shape Containers to easily print them to a 8.5x11 page. And can any of you point me to some tutorials or good examples or the print function of VB. It usually takes all the example I find on my own and one of your suggestions to finally get what I'm looking for.


Maybe add in some tips on how to print only the Shape Containers as well Right Now I Do a PrintForm(Print PreVeiw) and see all my buttons as well

How To: Filter a link list dropdown field in a form based on Active/Inactive field in the linked li


I need to filter a dropdown field on a form that is linked to another list.  The linked list has a field active/inactive and I only want the active ones to show on the form.

Trying to active form give the following error




This form was deploying and opening web based perfectly earlier now it started giving me the following error:

To note I have changed some of the node names but it seems to not generate any errors and the code behind is perfect.

There has been a critical error while processing the form.   at Microsoft.Office.InfoPath.Server.Administration.FormTemplate.GetLatestVersion()
   at Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver.CreateFieldsForFormTemplate(SPSite site, FormTemplate formTemplate, SPContentType formCt)
   at Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver.CreateFormContentTypeTemplate(SPSite site, String templateUrl, FormTemplate formTemplate)
   at Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver.CreateOrUpdateContentTypes(SPSite currentSite, String serverRelativeUrl, FormTemplate formTemplate)
   at Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver.FeatureActivated(SPFeatureReceiverProperties properties)
   at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)
   at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)
   at Micr

label in MDI parent form do not remain in background of child form ?



Please guide and help me.

I have a mdi partent form which has a lable in center of it (to display application name in center). On opening a form in this mdi parent this lable should appear on back side of newly opened form  but on showing a child form label appears in front of newly opend form (appears like newly opened form is between label and mdi parent).
How to manage it please guide me.


GridView Parent Child View with JQuery Effects

I was just checked how to add some more cool effects to the GridView control using JQuery. In this post I will display parent-child data in the GridView control with some help of the wonderful JQuery library.

Let's first populate the GridView control.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.
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