Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

  • jlgraybill

    jlgraybill

    Member

    4 Points

    10 Posts

    Referencing Custom Control names and properties within VB Code Behind

    May 13, 2009 05:28 AM | LINK

    Sorry for the basic questions, but I've been searching the web for a few days and can't find the answer to these questions.

    I've created a Custom Control, and I will be placing a large number of instances of that Custom Control on my xaml page.  In working with that Custom Control in the VB Code Behind, how do I do the following?

    1. How do I reference the name of the Custom Control (in my VB code) which was clicked with the MouseLeftButtonDown event?  For example, if I have 10 instances of my Custom Control in xaml, each with a different x:name (say 1-10), when a particular instance is clicked, how can I see which one was clicked?

    2. My Custom Control consists of numerous parts and pieces (Rectangles, Lines, Text, etc).  Each of these items is a part of my layer.  In VB code, once I can reference a particular Control, how can I hide or change certain parts of my control (such as hiding a Line, and changing the text).

    Thanks in advance, and sorry to all the C# experts that I need this in VB.  Thanks.