|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WinHelpLib;
namespace WinHelpTest
{
public partial class MainForm : Form
{
public WinHelpEx.HELP_CTRL_USE GetControlName(Control ctrl, ref string sName)
{
if (ctrl == btnHelp)
{
sName = "ButtonHelp";
return WinHelpEx.HELP_CTRL_USE.USE_NO_SUB;
}
sName = "";
return WinHelpEx.HELP_CTRL_USE.USE_SUB;
}
public WinHelpEx.HELP_CTRL_USE IsControlUsed(Control ctrl)
{
return WinHelpEx.HELP_CTRL_USE.USE_SUB;
}
public WinHelpEx.HELP_CTRL_USE IsControlTTUsed(Control ctrl)
{
if (ctrl == this)
{
return WinHelpEx.HELP_CTRL_USE.USE_SUB;
}
return WinHelpEx.HELP_CTRL_USE.USE_SUB;
}
Boolean IsCSHelpDlgt(Control ctrl)
{
if (ctrl == tvHF || ctrl == cbHC || ctrl == this)
{
return false;
}
return true;
}
public MainForm()
{
InitializeComponent();
try
{
Program.s_help.TestITSS(tvHF);
Program.s_help.AttachForm(null, this, true, IsControlUsed, GetControlName, IsCSHelpDlgt, IsControlTTUsed, GetControlName);
}
catch (Exception exc)
{
MessageBox.Show(exc.Message);
}
object[] arr = new[]
{
new { Text = "TableOfContents", Data = HelpNavigator.TableOfContents },
new { Text = "Topic", Data = HelpNavigator.Topic },
new { Text = "TopicId", Data = HelpNavigator.TopicId },
new { Text = "Index", Data = HelpNavigator.Index },
new { Text = "Find", Data = HelpNavigator.Find },
new { Text = "AssociateIndex", Data = HelpNavigator.AssociateIndex },
new { Text = "KeywordIndex", Data = HelpNavigator.KeywordIndex }
};
cbHC.DisplayMember = "Text";
cbHC.ValueMember = "Data";
cbHC.DataSource = arr;
}
private void btnHelp_Click(object sender, EventArgs e)
{
Program.s_help.ShowHelp(this,(HelpNavigator)cbHC.SelectedValue, tbKW.Text);
}
private void MainForm_HelpRequested(object sender, HelpEventArgs hlpevent)
{
}
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.