MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Print Dialog

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-16-2007
Member
Yellow Belt
 
Join Date: Jul 2007
Posts: 45
Print 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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 08-16-2007
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 248
Re: Print Dialog

Have you tried the PrintOut method with geoPrintDirections?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-17-2007
Member
Yellow Belt
 
Join Date: Jul 2007
Posts: 45
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 08-18-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
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);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 08-20-2007
Member
Yellow Belt
 
Join Date: Jul 2007
Posts: 45
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:
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);
bear with me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
dialog, print


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/print-dialog-6168.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 11:38 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54