Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reading text off of ((((System.Windows.Documents.Hyperlink)(e.OriginalSource as FrameworkContentElement))))

Posted on 2010-09-02
6
Medium Priority
?
471 Views
Last Modified: 2013-12-17
Experts I need to do get the text off of System.Windows.Documents.Hyperlink on my win form. What do i do ? I am using it in WPF ? So i do the following

((((System.Windows.Documents.Hyperlink)(e.OriginalSource as FrameworkContentElement)))).Text

But get an error saying the get is inaccessible .....
0
Comment
Question by:dotnetpro
  • 4
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
jhshukla earned 1500 total points
ID: 33592217
What's the point of casting plus as-operator? you need only one. Seems like you are more interested in the Hyperlink class. Have you tried NavigateUri?
http://msdn.microsoft.com/en-us/library/system.windows.documents.hyperlink.navigateuri.aspx
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 33596160
that is also coming in as null
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 33596170
I am looking to read the hyperlinked text on my form. So if "Click here" is hyperlink i want to read "Click here" in my code.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 9

Expert Comment

by:jhshukla
ID: 33614558
I see. I misunderstood your question.
Perhaps you would want to try ContentStart or ContentEnd and corresponding methods.
http://msdn.microsoft.com/en-us/library/system.windows.documents.textpointer_methods.aspx
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 33618156
You know i was able to do this myself. I had to cast the "Tag" property of the HyperLink to one of our custom navigation objects and there by reading a custom property. But i appreciate your help.
0
 
LVL 1

Author Closing Comment

by:dotnetpro
ID: 33618210
The answer was not useful to me at all, but i appreciate the time expert took to answer my question.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question