Paul Hacker .Net, TFS, Etc…

May 8, 2007

Add the TFS LinksControl to your app

Filed under: Team System — phacker @ 3:05 pm

I recently saw a post on MSDN asking about how to access the LinksControl in TFS. I decided that I would try to answer this by actually creating a simple app to see if it was possible. You will need to add a reference to the using Microsoft.TeamFoundation.WorkItemTracking.Controls

I created a simple WinForm that had a button and a panel on it. This is extremely simple, but it allowed me to add the control to my app.

 The down side is that the AddLink capabilities are not public.

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.TeamFoundation.WorkItemTracking.Controls;

namespace LinksTestbed
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
LinksControl link = new LinksControl();
link.Dock = DockStyle.Fill;
panel1.Controls.Add(link);
}
}
}

 

-paul

Blog at WordPress.com.