By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,671 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,671 IT Pros & Developers. It's quick & easy.

PrintDialog AllowSelection and make checked

P: n/a
Does anybody know how to check the AllowSelection radio button in the
PrintDialog Dialog? I want to set this to checked if the user has
selected a subset of text.
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Hi David,

Thank you for posting in the community!

Based on my understanding, you use PrintDialog class to display a print
dialog. If the user have selected some text for print, you want the print
dialog to select the "selection" option.

===========================================
Actually, .Net PrintDialog class does not expose the way to select this
option button.

I think the workaround is in the initialize period P/invoke FindWindow
win32 API function to get the window handle of "selection" option button.
Then send a BM_SETCHECK message to this option button to set it checked.

Because PrintDialog is a sealed class, to hook into the initialize period
of PrintDialog, you should inherit from CommonDialog, do like follow steps:
1. Create a new class inheriting from CommonDialog
http://www.dotnet247.com/247referenc...monDialog.aspx
2. Override the RunDialog method and call the standard windows API
functions to bring up a common dialog
3. Handle the WM_INITDIALOG messages in the HookProc the adding the
functionality to the common dialog

So the entire process is too complex and cost too much for you. I think it
is a good idea to leave away from this complex, leave this selection to the
user.

==========================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Have a nice day!!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #2

P: n/a

Hi David,

Does my reply make sense to you?

If you still have anything unclear, please feel free to post, I will help
you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.