Community of VE/MapPoint Users and Developers
This is a discussion on Print Dialog within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, the mappoint control got this nice print-dialog if i right-click in the itinerary. How can i call this dialog ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Re: Print Dialog
Have you tried the PrintOut method with geoPrintDirections? |
| |||
| Re: Print Dialog
Yes, but it's just 1 option. In the dialog you can customize everything. If i use the method i got to write those dialogs by myself ... it would be much easier to just use the existing dialog in the control. Found something with the hidden features but can't quite understand it because it is ... confussing, no simple code that works, just a few lines. If someone wrote it already it would be great to post it. thanks |
| |||
| Re: Print Dialog
Hi, Wy don't you build your own dialog ? It is only a form with a few checkboxes and a few buttons. Adavantage is that it has your personal design ! Here is some code: Code: public partial class Print : Form
{
private AxMapPoint.AxMappointControl mp;
public GeoPrintArea area;
public int quality = 1;
public int orientation = 1;
public Print(AxMapPoint.AxMappointControl MP)
{
InitializeComponent();
mp = MP;
ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_Printer");
foreach (ManagementObject printer in searcher.Get()) {
string name = printer["Name"].ToString();
selectedPrinter.Items.Add(name);
}
if (selectedPrinter.Items.Count > 0)
selectedPrinter.SelectedIndex = 0;
DateTime Now = System.DateTime.Now;
title.Text = Now.ToLongDateString() + ", " + Now.ToShortTimeString();
zone_route.Enabled = mp.ActiveMap.ActiveRoute.IsCalculated;
zone_turn.Enabled = mp.ActiveMap.ActiveRoute.IsCalculated;
zone_strip.Enabled = mp.ActiveMap.ActiveRoute.IsCalculated;
}
private void zone_map_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
area = GeoPrintArea.geoPrintMap;
}
private void zone_route_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
area = GeoPrintArea.geoPrintDirections;
}
private void zone_turn_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
area = GeoPrintArea.geoPrintTurnByTurn;
}
private void zone_strip_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
area = GeoPrintArea.geoPrintStripMaps;
}
private void zone_zone_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
area = GeoPrintArea.geoPrintSelectedArea;
}
private void zone_selected_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
area = GeoPrintArea.geoPrintHighlightedPlaces;
}
private void draft_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
quality = 0;
}
private void normal_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
quality = 1;
}
private void presentation_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
quality = 2;
}
private void direction_auto_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
orientation = 0;
}
private void direction_landscape_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
orientation = 1;
}
private void direction_portret_CheckedChanged(object sender, EventArgs e)
{
RadioButton rb = (RadioButton)sender;
if (rb.Checked)
orientation = 2;
}
private void OkBtn_Click(object sender, EventArgs e)
{
mp.ActivePrinter = selectedPrinter.Items[selectedPrinter.SelectedIndex].ToString();
mp.ActiveMap.PrintOut("",
title.Text,
(int)copies.Value,
area,
(GeoPrintQuality)quality,
(GeoPrintOrientation)orientation,
collate.Checked,
legend.Checked,
overview.Checked,
faxable.Checked);
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Print Dialog
Hi, the thing is, when i make my own dialog, the dialog in the itinerary is still existing, to me 2 different styles are more bad than an old fashioned print dialog. Finally understood and could use the hidden feature thing in the forum, just one comment was useful, here the adjusted code: (c# .net) Imports: Code: [DllImport("user32.dll")]private static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, IntPtr windowTitle);
[DllImport("user32.dll")]private static extern Boolean PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
Code: IntPtr hwnd; IntPtr mapPointHwnd; hwnd = FindWindowEx(mapPointControl.Handle, IntPtr.Zero, "ATL:100240A0", IntPtr.Zero); mapPointHwnd = FindWindowEx(hwnd, IntPtr.Zero, "AfxFrameOrView70", IntPtr.Zero); //55955 Message for the Print dialog //0x0111 = WM_COMMAND PostMessage(mapPointHwnd, ((int)0x0111), 55955, 0); |
![]() |
| Tags |
| dialog, print |
| ||||
| Posted By | For | Type | Date | |
| Merging Multiple Routes - MapPoint Articles - MP2K Magazine | This thread | Refback | 08-25-2007 06:27 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: toolbars in mfc dialog | djcapslock | MapPoint 2006/2009 Discussion | 2 | 06-04-2005 06:39 AM |
| Print Dialog!!!! | Anonymous | MapPoint 2006/2009 Discussion | 0 | 11-18-2004 12:18 PM |
| avoid MP std save dialog?¿? | Nostradamus | MapPoint 2006/2009 Discussion | 3 | 09-08-2004 10:13 AM |
| mapbasic dialog | Anonymous | MapPoint 2006/2009 Discussion | 0 | 06-28-2004 08:50 AM |
| Anyone who build a Print-Dialog for Mappoint-Control? | Syd | MapPoint 2006/2009 Discussion | 1 | 12-18-2003 08:22 AM |