本文整理汇总了C#中System.Windows.Forms.AxHost.AboutBoxDelegate代理的典型用法代码示例。如果您正苦于以下问题:C# AxHost.AboutBoxDelegate代理的具体用法?C# AxHost.AboutBoxDelegate怎么用?C# AxHost.AboutBoxDelegate使用的例子?那么恭喜您, 这里精选的代理代码示例或许可以为您提供帮助。
AxHost.AboutBoxDelegate代理属于System.Windows.Forms命名空间,在下文中一共展示了AxHost.AboutBoxDelegate代理的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AxMaskEdBox
public AxMaskEdBox()
:
base("c932ba85-4374-101b-a56c-00aa003668dc") // The ActiveX control's class identifier.
{
// Make the AboutBox method the about box delegate.
this.SetAboutBoxDelegate(new AboutBoxDelegate(AboutBox));
}
public virtual void AboutBox()
{
// If the instance of the ActiveX control is null when the AboutBox method
// is called, raise an InvalidActiveXStateException exception.
if ((this.ocx == null))
{
throw new System.Windows.Forms.AxHost.InvalidActiveXStateException(
"AboutBox", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke);
}
// Show the about box if the ActiveX control has one.
if (this.HasAboutBox)
{
this.ocx.AboutBox();
}
}
protected override void AttachInterfaces()
{
try
{
// Attach the IMSMask interface to the ActiveX control.
this.ocx = ((MSMask.IMSMask)(this.GetOcx()));
}
catch (System.Exception ex)
{
System.Console.WriteLine(ex.Message);
}
}