Search 
DailyCoding > Windows

Using Microsoft Agent in Windows .Net Application

How to use and animate MS in .NET Applications
Author admin on Jul 4, 2008 0 Comments
Rate it    (Rated 5 by 1 people)
301 Views

MS Agent is a graphical character that might be used for animated help, learning etc.

Microsoft® Agent is a software technology that enables an enriched form of user interaction that can make using and learning to use a computer, easier and more natural.

MS Agent can be easily integate into windows .net application. Below is the step by step process to add MS Agent into you .net application and do basic animation.

Step 1

Create a new .net windows application

Step 2

Add AxAgent control in the ToolBox from the COM Components. To do this right click on tool box and select "Chose Item". A pop up will appear. Select "COM Components" and scroll down to "Microsoft Agent Control 2.0". Select and add reference to your application.

Step 3

A new control "AxAgent" will appear in the ToolBox. Add this control to you windows form by dragging it on the form.

Step 4

Open the source of the form and create a new character.

public partial class Form2 : Form
{
  AgentObjects.IAgentCtlCharacter character;

Step 5

Now, we have to intialize the agent on form load. To do this add below code

private void Form2_Load(object sender, EventArgs e)
{
	this.axAgent1.Characters.Load("merlin", "merlin.acs");
	this.character = this.axAgent1.Characters["merlin"];
	this.character.Show(null);
}

If you see above code then you may notice that we are using "Merlin" agent. To use any agent, you must have that agent installed on your system. You can download agents from the Microsoft Agent website.


You agent is ready. You can animate this by using its commands. Below are some animation samples.

Move


this.character.MoveTo(120, 120, null);

Talk


this.character.Speak("Welcome to DailyCoding..!!", null);

Other Animations


this.character.Play("Reading");

this.character.Play("Process");

Utility | Windows

Discussion

Leave a Comment

Name
Email Address
Web Site
© Copyright 2008 Daily Coding • All rights reserved