|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace ContextHelpMadeEasy
{
/// <summary>
/// To be implemented by any control which provides a help context
/// </summary>
public interface IContextHelp
{
string ContextHelpID { get; }
}
/// <summary>
/// Create PanelEx is just like a Panel, except that it implements
/// IContextHelp
/// </summary>
public class PanelEx : Panel, IContextHelp
{
private string m_sContextID;
public string ContextHelpID
{
get
{
if (string.IsNullOrEmpty(m_sContextID))
return this.Name;
return m_sContextID;
}
set { m_sContextID = value; }
}
}
public class TextBoxEx: TextBox, IContextHelp
{
private string m_sContextID;
public string ContextHelpID
{
get
{
if( string.IsNullOrEmpty(m_sContextID) )
return this.Name;
return m_sContextID;
}
set { m_sContextID = value; }
}
}
public class ButtonEx : Button, IContextHelp
{
private string m_sContextID;
public string ContextHelpID
{
get
{
if (string.IsNullOrEmpty(m_sContextID))
return this.Name;
return m_sContextID;
}
set { m_sContextID = value; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I've been programming in C, C++, Visual Basic and C# for over 35 years. I've worked at Sierra Systems, ViewStar, Mosaix, Lucent, Avaya, Avinon, Apptero, Serena and now Guidewire Software in various roles over my career.