Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
345
WinToolBar error after upgrade from .Net 1.1 to 2.0
posted

Hi, 

 I have an application originally writter in VB.Net, under framework 1.1. It has no bugs. But after I upgraded to framework 2.0, I got a strange exception that I don't know how to solve. Here is the detail:

  • Version: Infragistics.Win.UltraWinToolbars.v6.2
  • Error Msg: This property is read-only at runtime.
  • Trace: Infragistics.Win.UltraWinToolbars.ToolBase.set_Key(String value)

The purpose of function that has error is to remove unwanted toolbar buttons. It will run everytime the form opens. This is the code

With CType(Me.MdiParent, Object)
        For Each tool As ToolBase In My_Menu.Tools
              If CType(.mdiMenu, UltraToolbarsManager).Tools.Exists(tool.Key) AndAlso Not IsDBNull(tool.SharedProps.Category) AndAlso Not tool.SharedProps.Category = String.Empty Then
                    .mdimenu.Tools.Remove(.mdimenu.Tools(tool.Key))
                    If CType(.mdimenu, UltraToolbarsManager).Tools.Exists(tool.SharedProps.Category) AndAlso CType(.mdimenu.Tools(tool.SharedProps.Category), PopupMenuTool).Tools.Count = 0 Then
                        CType(.mdimenu.Tools(tool.SharedProps.Category), PopupMenuTool).SharedProps.Visible = False
                    End If
              End If
        Next
 End With

Can anybody tell me what's wrong?