Quantcast
Channel: Off-Topic Posts (Do Not Post Here) forum
Viewing all articles
Browse latest Browse all 14169

VB.NET: how to handle runtime error "Unable to cast object of type 'Infragistics.Win.UltraWinTabControl.UltraTab' to customized type 'xxx.Tools.Windows.TabObject'

$
0
0

Our application is vb.net applicaiton.

we have created customized object called "TabObject".

Public Class TabObject
    Inherits Infragistics.Win.UltraWinTabControl.UltraTab
    Public Sub New()
        MyBase.New()
    End Sub  Private mbAllowEdit As Boolean = True
    Public Sub New(ByVal bPassParamter As Boolean)
        MyBase.New(bPassParamter)
    End Sub   
    Public Property AllowEdit As Boolean
        Get
            Return mbAllowEdit
        End Get
        Set(value As Boolean)
            mbAllowEdit = value
        End Set
    End Property
End Class

Then we replace

"Dim UltraTab1 As xxx.Tools.Windows.TabObject = New xxx.Tools.Windows.TabObject()"
We build solution and run the solution without problem.

Later, we open one form in design and save. the above line change to

"Dim UltraTab1 As MenuLink.Tools.Windows.TabObject = CType(New Infragistics.Win.UltraWinTabControl.UltraTab(), xxx.Tools.Windows.TabObject)"

it builds fine and when running the application and get the following error:

"System.InvalidCastException: Unable to cast object of type 'Infragistics.Win.UltraWinTabControl.UltraTab' to type 'xxx.Tools.Windows.TabObject'."

Does anyone know how to fix this problem? Thx



JaneC


Viewing all articles
Browse latest Browse all 14169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>