本文整理汇总了C#中System.Windows.Forms.AxHost.InvalidActiveXStateException类的典型用法代码示例。如果您正苦于以下问题:C# AxHost.InvalidActiveXStateException类的具体用法?C# AxHost.InvalidActiveXStateException怎么用?C# AxHost.InvalidActiveXStateException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AxHost.InvalidActiveXStateException类属于System.Windows.Forms命名空间,在下文中一共展示了AxHost.InvalidActiveXStateException类的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);
}
}