Click here to Skip to main content
15,881,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Team,
I have a printdocument page in printpreview dialog and which is a mdi child form in vb.net.
when i close the mdiform(mdiparent) every time it is calling the printdocuments beginprint/printpage event again and every time the mdi close method is called,can we stop doing this behavior.

in printdocument constructor i passed the Mdi_Form
on menu click in mdi form i called the constructor and constructor code is below
Dim PrintDialog1 as new PrintPreviewDialog
PrintDialog1.Document = PrintDocument 'PrintDialog associate with PrintDocument.
PrintDialog1.mdiparent=mdiform
PrintDialog1.Show()


and all the required codes for printing is in
Print_Doc----Begin_print and Print_Page event

its working fine but when i closed the mdi form it again call only these events
Print_Doc----Begin_print and Print_Page event
Thanks
Sukhen Dass
Posted
Updated 19-Dec-13 20:11pm
v5
Comments
An@nd Rajan10 20-Dec-13 1:16am    
mention your code for MDI form
ridoy 20-Dec-13 1:51am    
show the code here.

1 solution

Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
How to Create MDI Parent Window in WPF?[^].

I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF? [Solution 2],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

—SA
 
Share this answer
 
Comments
sukhen dass 20-Dec-13 2:52am    
thanks for the suggestion but can not change the application which is live
Sergey Alexandrovich Kryukov 20-Dec-13 3:08am    
I would not be so sure... However, this is your problem, but you cannot live with it long...
You already have an unpleasant problem, and you can have more, even more unpleasant, and not many would be interested in helping you to fix it. If an egg is rotten, no need to eat it all... :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900