public AgentController(AxAgentObjects.AxAgent agentHost, string character) { agentHost.Characters.Load(character, null); agentChar = agentHost.Characters[character]; characterName = character; // You could put your own options in this menu, if desired. agentChar.AutoPopupMenu = false; // Set balloon style. agentChar.Balloon.Style = agentChar.Balloon.Style | BalloonOn; agentChar.Balloon.Style = agentChar.Balloon.Style | SizeToText; agentChar.Balloon.Style = agentChar.Balloon.Style | AutoHide; }
/// <summary> /// activate timer for start tracking agent location /// </summary> private void axAgent1_DragStart(object sender, AxAgentObjects._AgentEvents_DragStartEvent e) { timer1.Enabled=true; }
/// <summary> /// deactivate timer and stop tracking /// </summary> private void axAgent1_DragComplete(object sender, AxAgentObjects._AgentEvents_DragCompleteEvent e) { timer1.Enabled=false; }
/// <summary> /// because agent1 dos not support context menu /// we show it in the main form in the clicked place /// </summary> private void axAgent1_ClickEvent(object sender, AxAgentObjects._AgentEvents_ClickEvent e) { if (e.button==2) { Point pnt=new Point(e.x-this.Left,e.y-this.Top); contextMenu1.Show(this,pnt); } }