Manages a collection of SmartTips in conjunction with
a dedicated SmartTips form.
System Object CleanCode.Forms SmartTipsManagerNamespace: CleanCode.FormsAssembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
public class SmartTipsManager
public class SmartTipsManager
Public Class SmartTipsManager
Public Class SmartTipsManager
public ref class SmartTipsManager
public ref class SmartTipsManager
You must create and supply to a
SmartTipsManager
a dedicated
SmartTips form.
The form must have:
-
A TabControl containing
a collection of TabPages.
Each TabPage details one SmartTip; the name
of the TabPage must be xxxTabPage,
where xxx is the unique identifier of the SmartTip.
-
A common CheckBox for suppressing
the current SmartTip.
-
A common CheckBox for disabling all SmartTips.
Include this code in the
Load event handler for your form. The first
line is a suggestion for persisting settings from previous invocations.
You could just pass an empty string if persistence is not required.
string initialPackedDictionary = Properties.Settings.Default.SmartTipsDict;
smartTipsManager = new SmartTipsManager(this, smartTrace,
initialPackedDictionary, tabControl, defaultTabPage,
suppressCheckBox, disableCheckBox);
smartTipsManager.SetLastTab();
string initialPackedDictionary = Properties.Settings.Default.SmartTipsDict;
smartTipsManager = new SmartTipsManager(this, smartTrace,
initialPackedDictionary, tabControl, defaultTabPage,
suppressCheckBox, disableCheckBox);
smartTipsManager.SetLastTab();
Include this in the
FormClosing event handler for form. The first line
provides for proper closing or hiding of the SmartTips form. The second line
is a suggestion on how to persist the settings for subsequent invocations.
smartTipsManager.HandleFormClosing(e);
Properties.Settings.Default.SmartTipsDict = smartTipsManager.GetDictionary();
smartTipsManager.HandleFormClosing(e);
Properties.Settings.Default.SmartTipsDict = smartTipsManager.GetDictionary();
Include this in the
Enter event handler for every
TabPage on your
SmartTips form.
smartTipsManager.InitializeTab();
smartTipsManager.InitializeTab();
smartTipsManager.ResetAllTabs();
smartTipsManager.SetSuppressed();
smartTipsManager.ShowTip(attribute);
smartTipsManager.ResetAllTabs(); // To re-enable all suppressed tabs.
smartTipsManager.SetSuppressed(); // To suppress or allow current tab.
smartTipsManager.ShowTip(attribute); // To show a tip
The remaining methods should be connected as needed
to controls on your form as appropriate:
Since CleanCode 0.9.07.