.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

InvalidOperationException: 'System.Windows.Documents.Hyperlink' is not a Visual or Visual3D

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :JQuery

I have a simple TreeView with a template containing a TextBlock with an inline Hyperlink. Whenever I use the keyboard to navigate the tree to this templated item, I get this:


'System.Windows.Documents.Hyperlink' is not a Visual or Visual3D.
   at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
   at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
   at System.Windows.Controls.TreeViewItem.AllowHandleKeyEvent(FocusNavigationDirection direction)
   at System.Windows.Controls.TreeViewItem.HandleDownKey()
   at System.Windows.Controls.TreeViewItem.OnKeyDown(KeyEventArgs e)
   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.

View Complete Post

More Related Resource Links

Word Interop - System.InvalidOperationException in System.Windows.Forms.dll



Microsoft Visual Studio 2005 Version 8.0.50727.42 

Microsoft .NET Framework Version 2.0.50727

Word 2003 Interop


I am trying to recreate the "AmbiguousMember" example from p. 31 of Whitechapel's "MS .NET Development for MS Office" using VB instead of VC#.

This involves implementing an event handler for the Word Quit event. In the event handler, I need to toggle the Enabled state of two buttons. This causes the following error:

A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll

The code behind the Form1 form is shown below. Form1 has two buttons: Button1 "Run Word"; Button2 "Quit Word". The event handler is intended to clean up if the user quits the Word application, and reset the buttons.

A net s

System.Windows.Documents Namespace not found


I'm using ASP.NET4.0, and getting the following compilation error:

CS0234: The type or namespace name 'Documents' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)

Source Error:

Line 20: using System.Web.UI.HtmlControls;
Line 21: using System.Security.Principal;
Line 22: using System.Windows.Documents;
Line 23: 
Line 24: /// <summary> ///

Source File: c:\Documents and Settings\stilwell\Desktop\DEV40-1\App_Code\LoadForm.cs    Line: 2

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend