Hi,
the mappoint control got this nice print-dialog if i right-click in the itinerary.
How can i call this dialog or is there any other way to use it?
This is a discussion on Print Dialog within the MapPoint Desktop 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 ...
Hi,
the mappoint control got this nice print-dialog if i right-click in the itinerary.
How can i call this dialog or is there any other way to use it?
Have you tried the PrintOut method with geoPrintDirections?
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
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
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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: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);
bear with meCode: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);![]()
Hi,
This purticular code works with Mappoint 2009, but when I switched my application to Mappoint 2011, the mappoint printer dialog is not showing up.
It seems the post message number wParam value 55955 is changed. Any idea how to get the mappoint printer dialog to work with mappoint 2011.
If anybody got this working it will be really helpful.PostMessage(mapPointHwnd, ((int)0x0111), 55955, 0);
Thanks
If someone knows how to do this (e.g. find what wParam or message values to pass to various MapPoint functions), perhaps they could also help with the Programming Challenge here?
What's New at MP2K Magazine
~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
~~
~ Upgrade to Get Access to the MapForums Downloads ~
There are currently 1 users browsing this thread. (0 members and 1 guests)