添加地图标题的核心代码如下
private IHookHelper m_hookHelper = null;
private IPageLayoutControl2 axPageControl;
private TitleForm frmTitle; //设置标题样式的窗体
private string title = "";
private System.Drawing.Font font ;
private System.Drawing.Color color ;
/// <summary>
/// Occurs when this command is clicked/// </summary>
public override void OnClick()
{
// TODO: Add AddTitleCommand.OnClick implementation
IEnvelope pEnvelope = PageManager.GetEnvelopeInPage2(axPageControl, 0.5, 0.9, 2, 1);
if (pEnvelope.IsEmpty || pEnvelope == null || pEnvelope.Width == 0 || pEnvelope.Height == 0)
{
return;
}