本文整理匯總了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);
}
}