阅读:2773回复:6
[分享]解决问题得到ArcEngine无限期许可
<P>在C#+ArcEngine进行开发时,发现了个奇怪的问题,TOCControl控件的MouseUp事件激发时,第一次单击激发不了,必须双击才能激发MouseUp事件,在同事的机器上试了也不行,哪位高手给个答案?</P>
<P>解决问题将得到ArcEngine9.0无限期许可,包括所有功能。</P> |
|
1楼#
发布于:2006-05-09 17:06
说详细点,给出代码
|
|
|
2楼#
发布于:2006-05-11 08:51
在你双击后,是否单击也能触发呢?如果是,估计你的toc在某个界面控件中,第一击只是获得焦点,第二击才能触发事件。
|
|
|
3楼#
发布于:2006-05-11 09:17
<P>TOC控件没有放在任何控件上,而且左键的MouseUp就可以,就是右键不行,代码如下:</P>
<P>using System;<br>using System.Drawing;<br>using System.Collections;<br>using System.ComponentModel;<br>using System.Windows.Forms;<br>using System.Data;</P> <P>namespace WindowsApplication1<br>{<br>/// <summary><br>/// Form1 的摘要说明。<br>/// </summary><br>public class Form1 : System.Windows.Forms.Form<br>{<br> private AxesriTOCControl.AxTOCControl axTOCControl1;<br> private AxesriMapControl.AxMapControl axMapControl1;<br> private System.Windows.Forms.Splitter splitter1;<br> /// <summary><br> /// 必需的设计器变量。<br> /// </summary><br> private System.ComponentModel.Container components = null;</P> <P> public Form1()<br> {<br> //<br> // Windows 窗体设计器支持所必需的<br> //<br> InitializeComponent();</P> <P> //<br> // TOD 在 InitializeComponent 调用后添加任何构造函数代码<br> //<br> }</P> <P> /// <summary><br> /// 清理所有正在使用的资源。<br> /// </summary><br> protected override void Dispose( bool disposing )<br> {<br> if( disposing )<br> {<br> if (components != null) <br> {<br> components.Dispose();<br> }<br> }<br> base.Dispose( disposing );<br> }</P> <P> #region Windows 窗体设计器生成的代码<br> /// <summary><br> /// 设计器支持所需的方法 - 不要使用代码编辑器修改<br> /// 此方法的内容。<br> /// </summary><br> private void InitializeComponent()<br> {<br> System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));<br> this.axTOCControl1 = new AxesriTOCControl.AxTOCControl();<br> this.axMapControl1 = new AxesriMapControl.AxMapControl();<br> this.splitter1 = new System.Windows.Forms.Splitter();<br> ((System.ComponentModel.ISupportInitialize)(this.axTOCControl1)).BeginInit();<br> ((System.ComponentModel.ISupportInitialize)(this.axMapControl1)).BeginInit();<br> this.SuspendLayout();<br> // <br> // axTOCControl1<br> // <br> this.axTOCControl1.Dock = System.Windows.Forms.DockStyle.Left;<br> this.axTOCControl1.Location = new System.Drawing.Point(0, 0);<br> this.axTOCControl1.Name = "axTOCControl1";<br> this.axTOCControl1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axTOCControl1.OcxState")));<br> this.axTOCControl1.Size = new System.Drawing.Size(160, 270);<br> this.axTOCControl1.TabIndex = 0;<br> this.axTOCControl1.OnMouseUp += new <FONT color=#f73809>AxesriTOCControl.ITOCControlEvents_OnMouseUpEventHandler(this.axTOCControl1_OnMouseUp);<br></FONT> // <br> // axMapControl1<br> // <br> this.axMapControl1.Dock = System.Windows.Forms.DockStyle.Fill;<br> this.axMapControl1.Location = new System.Drawing.Point(160, 0);<br> this.axMapControl1.Name = "axMapControl1";<br> this.axMapControl1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMapControl1.OcxState")));<br> this.axMapControl1.Size = new System.Drawing.Size(240, 270);<br> this.axMapControl1.TabIndex = 1;<br> // <br> // splitter1<br> // <br> this.splitter1.Location = new System.Drawing.Point(160, 0);<br> this.splitter1.Name = "splitter1";<br> this.splitter1.Size = new System.Drawing.Size(3, 270);<br> this.splitter1.TabIndex = 2;<br> this.splitter1.TabStop = false;<br> // <br> // Form1<br> // <br> this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);<br> this.ClientSize = new System.Drawing.Size(400, 270);<br> this.Controls.Add(this.splitter1);<br> this.Controls.Add(this.axMapControl1);<br> this.Controls.Add(this.axTOCControl1);<br> this.Name = "Form1";<br> this.Text = "Form1";<br> ((System.ComponentModel.ISupportInitialize)(this.axTOCControl1)).EndInit();<br> ((System.ComponentModel.ISupportInitialize)(this.axMapControl1)).EndInit();<br> this.ResumeLayout(false);</P> <P> }<br> #endregion</P> <P> /// <summary><br> /// 应用程序的主入口点。<br> /// </summary><br> [STAThread]<br> static void Main() <br> {<br> Application.Run(new Form1());<br> }</P> <P> <FONT color=#f70909>private void axTOCControl1_OnMouseUp(object sender, AxesriTOCControl.ITOCControlEvents_OnMouseUpEvent e)<br> {<br> if(e.button==1)<br> {<br> MessageBox.Show("左键起...");<br> }<br> else if(e.button==2)<br> {<br> MessageBox.Show("右键起...");<br> }<br> }<br></FONT>}<br>}</P> [此贴子已经被作者于2006-5-11 9:19:11编辑过]
|
|
4楼#
发布于:2006-05-11 16:26
<P>刚问了在ESRI公司的同学,是一个BUG,太烂了!</P>
|
|
5楼#
发布于:2006-05-12 13:06
楼主能把<STRONG>ArcEngine无限期许可公布出来吗?</STRONG>
|
|
6楼#
发布于:2006-05-15 08:06
我用vb.net写的,似乎没用这个问题
|
|
|