Solved

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

Posted on 2010-09-02
6
438 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 500 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…

828 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