473,785 Members | 2,819 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Closing a PrintPreviewDia log with the escape key

Hi There,

I am trying to add the option to close a PrintPreviewDia log using the
escape key.

Firstly is there an option when creating a PrintPreviewDia log that
would allow me to do that?

I have tried to inherit the PrintPreviewDia log and override the key
events. That didn't work.

I also tried to catch the key events using a deligate. That also
didn't work

Thanks,

Peter.

Mar 13 '07 #1
2 2083
VJ
Well you could try to send a WM_Close message to the window on Esc key
press, is that what you tried? There seems to be a override for
ProcessKeyMessa ge, did you try that? There is also a ProcessKeyDialo g(), for
override. One of them should do it. I feel bad for suggesting Trial/Error
methods, but if you have tried all of it, I will check my team that wrote
our printing compnent, see if we can help you better..Our app seems to close
it on cancel, I just don't have code now to see what it does.

VJ

<pe************ *@gmail.comwrot e in message
news:11******** **************@ s48g2000cws.goo glegroups.com.. .
Hi There,

I am trying to add the option to close a PrintPreviewDia log using the
escape key.

Firstly is there an option when creating a PrintPreviewDia log that
would allow me to do that?

I have tried to inherit the PrintPreviewDia log and override the key
events. That didn't work.

I also tried to catch the key events using a deligate. That also
didn't work

Thanks,

Peter.

Mar 13 '07 #2
Try overriding ProcessCmdKey and try catching the esc key there.

=============== =====
Clay Burch
Syncfusion, Inc.

Mar 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14446
by: Michael A. Covington | last post by:
By default, my PrintPreviewDialog is coming out too small. What is the best way to control its size and position? Ideally, I'd just like to maximize it. Thanks!
2
5870
by: Randy | last post by:
Hello all, I'm trying to print using PrintPreviewDialog. What's happening is that the PrintPreviewDialog shows the correct information to be printed, but when I click the print icon, it prints a blank page. If I comment out the printPreviewDialog1.ShowDialog(); and just do a printDocument1.Print(); instead, it prints all the pages like a champ. Anyone know what I'm doing wrong? Thanks
3
22978
by: sachin | last post by:
How to customize PrintPreviewDialog, such that, addition of a new button, change the functionality of existing button should be possible programatically. Sample code will help a lot. Moreover, what happens before the document gets displayed in PrintPreviewDialog, i.e. whether entire document gets copied in printer driver spool or only 1 or 2 pages? please guide regards
0
1597
by: Harry J. Smith | last post by:
I am using the PrintPreviewDialog Window Form from the Toolbox. It displays my RichTextBox contents correctly, but when I click on the Print icon on this form it prints one blank page and no text. How can I fix this to print the text that is being displayed? Here is the code I use to bring up the form: string stringText = helpTextOut.Text;
1
4416
by: Jack E. Hardie | last post by:
When I call the PrintPreviewDialog, the resulting default window and zoom size are too small to read. I have figured out how to resize the window, but can someone help me with the call to preset the zoom to 100% instead of the default Auto? My code is as follows: ' The PrintPreviewDialog is associated with the PrintDocument as the preview is ' rendered, the PrintPage event is triggered. This event is passed a graphics ' context where...
1
5709
by: Darrell Wesley | last post by:
Is there anyway to hook the PrintDialog to the printer icon on the PrintPreviewDialog? I know that you can print a document using the PrintDialog but it does not allow previewing and the PrintPreview dialog does not allow you to select a printer - is there a good and simple way to get around these problems. My users would like to select a specific printer while looking at the Preview window.
1
1702
by: jacopomeucci | last post by:
hi all. I've a problem with PrintPreviewDialog in c#. I've done a form with a ListViewControl and i tried to print the data contents in this listview. I've read the ListViewControl via a WHILE cicle and i've done document then i've send it to the PrintPreviewDialog...end it seems to be perfect but when i click the printer button on the PrintPreviewDialog
2
9875
by: Richard MSL | last post by:
I am using PrintPreviewDialog to preview a file. There is a button that the user can press, which seems to print the file to the default printer. I would like to capture a click on that button so that I can present a PrintDialog, print some files in a special way, etc. But there does not seem to be an event among the PrintPreviewDialog members to do this? Or perhaps I missed it? I would appreciate any suggestions. Thanks.
10
15334
by: choupi | last post by:
Hello, Is there a way to call a printDialog from a printPreviewDialog (from print icon for example)? Indeed, the print icon in the printpreviewdialog prints directly the document without lunching the printdialog (i.e. the user can't choose the print parameters). Thanks a lot.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.