Click here to Skip to main content
15,890,512 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to you generate itemized lists in a RichTextBox? Pin
fjparisIII24-May-10 9:17
fjparisIII24-May-10 9:17 
QuestionHow do you adjust leading between paragraphs in RichTextBox? [SOLVED THROUGH A KLUDGE] Pin
fjparisIII22-May-10 4:10
fjparisIII22-May-10 4:10 
AnswerRe: How do you adjust leading between paragraphs in RichTextBox? [SOLVED THROUGH A KLUDGE] Pin
Abhinav S24-May-10 17:28
Abhinav S24-May-10 17:28 
QuestionValidation Messages [modified] Pin
Tripathi Swati21-May-10 23:02
Tripathi Swati21-May-10 23:02 
AnswerRe: Validation Messages Pin
Abhinav S22-May-10 0:30
Abhinav S22-May-10 0:30 
GeneralRe: Validation Messages Pin
Tripathi Swati24-May-10 19:27
Tripathi Swati24-May-10 19:27 
AnswerRe: Border as control Pin
Jürgen Röhr22-May-10 2:23
professionalJürgen Röhr22-May-10 2:23 
GeneralRe: Border as control Pin
Jürgen Röhr22-May-10 21:40
professionalJürgen Röhr22-May-10 21:40 
Hi,

your problem has nothing to do with WPF; it's about C# fundamentals.

You might want to take a look at the inheritance tree. There you can see why you get that error. Neither Border nor Image derive from Control.

To be honest (really no flaming or insulting intended):
The best advice I can give you, is to take a good book about C#- or .Net basics and a little time.

In case I'm mistaken, I'll give you some clues (which hopefully will only help you if I'm mistaken):

1. ugly solution: use the VisualTreeHelper class.
2. ugly solution: use a common ancestor
3. good solution: use data binding

Both ugly solutions (as well as the provided code) imply that you will never use your own controls - or you'll get an endless list of "if ... GettYpe()". Solution #2 (as well as the provided code) still has to deal with the stacking of WPF objects (you will find the Border inside the Canvas, but you will not find the TextBox inside the Border).

Unfortunately I can't recommend any C# book, but if it's up to WPF (and accordingly data binding), I've learned a lot from "WPF unleashed".

Cheers
Jürgen
AnswerRe: Border as control Pin
Abhinav S22-May-10 2:30
Abhinav S22-May-10 2:30 
QuestionHow do you color a rectangle in C# that has been declared in XAML in WPF? Pin
Xarzu21-May-10 16:11
Xarzu21-May-10 16:11 
AnswerRe: How do you color a rectangle in C# that has been declared in XAML in WPF? Pin
Pete O'Hanlon21-May-10 23:44
mvePete O'Hanlon21-May-10 23:44 
GeneralRe: How do you color a rectangle in C# that has been declared in XAML in WPF? Pin
Xarzu22-May-10 1:58
Xarzu22-May-10 1:58 
GeneralRe: How do you color a rectangle in C# that has been declared in XAML in WPF? Pin
Pete O'Hanlon22-May-10 2:28
mvePete O'Hanlon22-May-10 2:28 
GeneralRe: How do you color a rectangle in C# that has been declared in XAML in WPF? Pin
Xarzu24-May-10 5:09
Xarzu24-May-10 5:09 
QuestionHow do you send a refresh message to a WPF grid or canvas? Pin
Xarzu21-May-10 16:10
Xarzu21-May-10 16:10 
AnswerRe: How do you send a refresh message to a WPF grid or canvas? Pin
Jürgen Röhr22-May-10 3:11
professionalJürgen Röhr22-May-10 3:11 
QuestionWPF TreeView - Get Reference To Image On Node Pin
Kevin Marois21-May-10 7:56
professionalKevin Marois21-May-10 7:56 
AnswerRe: WPF TreeView - Get Reference To Image On Node Pin
Pete O'Hanlon21-May-10 9:20
mvePete O'Hanlon21-May-10 9:20 
GeneralRe: WPF TreeView - Get Reference To Image On Node Pin
Kevin Marois21-May-10 10:20
professionalKevin Marois21-May-10 10:20 
QuestionTwo Way Data Binding In Wpf Pin
Manohar.K21-May-10 0:15
Manohar.K21-May-10 0:15 
AnswerRe: Two Way Data Binding In Wpf Pin
Pete O'Hanlon21-May-10 0:55
mvePete O'Hanlon21-May-10 0:55 
GeneralRe: Two Way Data Binding In Wpf Pin
Manohar.K21-May-10 1:35
Manohar.K21-May-10 1:35 
GeneralRe: Two Way Data Binding In Wpf Pin
Pete O'Hanlon21-May-10 1:54
mvePete O'Hanlon21-May-10 1:54 
GeneralRe: Two Way Data Binding In Wpf Pin
Manohar.K21-May-10 2:23
Manohar.K21-May-10 2:23 
GeneralRe: Two Way Data Binding In Wpf Pin
Pete O'Hanlon21-May-10 3:09
mvePete O'Hanlon21-May-10 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.