1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

Opening windows and accessing properties in WPF.

Discussion in 'Microsoft News' started by NewsBot, Mar 23, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    Okay, so I am trying to create a drawing program in WPF using InkCanvas and a couple of buttons to open up self-created tool windows to change properties of the pen.

    So far I've tried to make a (single) button in my WindowPenTools change the pen size from the default to a larger size.* So far, the only things that I can access in WindowMain are the events, and when I do type in the control name (which does not appear in Intellisense,) WindowMain.InkCanvas1, I see "Reference to a non-shared member requires an object reference."

    So I searched for a while and came across this:



    In Windows Forms, I did not have to do this (as far as I can remember,) It just worked .* And this is Visual Basic 2008 with .NET 3.5.

    So does this mean for every window that I want to able to change properties in, I would have to have 30+ lines of code in each form, even to open a window?




     

Share This Page