Dynamically Refreshing Properties Window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • senaka
    New Member
    • Feb 2007
    • 23

    Dynamically Refreshing Properties Window

    Hi,

    I want to refresh the properties window in Visual Studio through my code. This is how it works. I have made an onChanged event for a property that I defined. When this gets fired I need to update another property and refresh the properties window. Everything works fine, except I don't know how to refresh the properties window.

    Regards,
    Senaka
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by senaka
    Hi,

    I want to refresh the properties window in Visual Studio through my code. This is how it works. I have made an onChanged event for a property that I defined. When this gets fired I need to update another property and refresh the properties window. Everything works fine, except I don't know how to refresh the properties window.

    Regards,
    Senaka

    Could you explain a bit more about what a "properties window" is?

    Comment

    • senaka
      New Member
      • Feb 2007
      • 23

      #3
      Originally posted by Frinavale
      Could you explain a bit more about what a "properties window" is?
      The properties window is the one that shows up in Visual Studio in which we can set values for properties in the Design View. The one that comes up when you press F4.

      What I want to happen is this. I have a custom control having a property, say A. When my client uses this control in the design view in the studio and change A's value, another property, say B must also change accordingly, and the client must see that at both locations, the change has occured. However, the properties window does not refresh accordingly at all times and require a call to refresh it purposely. It does however gets refreshed automatically, when it looses focus and regains focus. This makes my client wonder why the two properties wont change at the same time. How can this be done?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by senaka
        The properties window is the one that shows up in Visual Studio in which we can set values for properties in the Design View. The one that comes up when you press F4.

        What I want to happen is this. I have a custom control having a property, say A. When my client uses this control in the design view in the studio and change A's value, another property, say B must also change accordingly, and the client must see that at both locations, the change has occured. However, the properties window does not refresh accordingly at all times and require a call to refresh it purposely. It does however gets refreshed automatically, when it looses focus and regains focus. This makes my client wonder why the two properties wont change at the same time. How can this be done?
        I don't know how this can be done because Visual Studio should do this for you.

        -Frinny

        Comment

        • Motoma
          Recognized Expert Specialist
          • Jan 2007
          • 3236

          #5
          You have been slightly ambiguous in your description of the problem. Perhaps you could reiterate what you are developing (desktop app, web service, etc...) and the language you are using, as well as the context (when, where, and how) in which the error occurs. Posting the relevant code would not hurt either.

          Comment

          • senaka
            New Member
            • Feb 2007
            • 23

            #6
            Originally posted by Motoma
            You have been slightly ambiguous in your description of the problem. Perhaps you could reiterate what you are developing (desktop app, web service, etc...) and the language you are using, as well as the context (when, where, and how) in which the error occurs. Posting the relevant code would not hurt either.
            well the code is a bit to big to write in here and involves many files, so i'm sorry about that. I'm developing an authentication module (desktop app accessing web service). The language is C#.NET Now, this contain a text box where the user can enter text for a username (an example). This text box, which is a part of the custom control is exposed as a property (the property is of type TextBox). For ease of use I'm implimenting another property in the custom control's property list, which can also modify the text of the textbox. Now, when the client enters a property value for one of the two, the event will be handelled and the other will be updated. This is implimented in both cases. Now, though in reality the designer.cs file updates accordingly, VS's properties window does not reflect the change.

            On the other hand, if I implimented a new properties window for my control using the VS2005 SDK, it would be quite cumbersome to re-write all the code for the exisisting properties...Ho wever, in this method, you can take control of the properties window and refresh it at value update events.

            Now, is the same possible without using the SDK? I believe that this can be achieved, but I havn't been able to exactly figure out how.

            Comment

            • Motoma
              Recognized Expert Specialist
              • Jan 2007
              • 3236

              #7
              So, if I am understanding you correctly, your issue is not with programming, rather, it is with the Visual Studio IDE not properly updating it's GUI to reflect changes you make in the code?

              Originally posted by senaka
              well the code is a bit to big to write in here and involves many files, so i'm sorry about that. I'm developing an authentication module (desktop app accessing web service). The language is C#.NET Now, this contain a text box where the user can enter text for a username (an example). This text box, which is a part of the custom control is exposed as a property (the property is of type TextBox). For ease of use I'm implimenting another property in the custom control's property list, which can also modify the text of the textbox. Now, when the client enters a property value for one of the two, the event will be handelled and the other will be updated. This is implimented in both cases. Now, though in reality the designer.cs file updates accordingly, VS's properties window does not reflect the change.

              On the other hand, if I implimented a new properties window for my control using the VS2005 SDK, it would be quite cumbersome to re-write all the code for the exisisting properties...Ho wever, in this method, you can take control of the properties window and refresh it at value update events.

              Now, is the same possible without using the SDK? I believe that this can be achieved, but I havn't been able to exactly figure out how.

              Comment

              • senaka
                New Member
                • Feb 2007
                • 23

                #8
                Originally posted by Motoma
                So, if I am understanding you correctly, your issue is not with programming, rather, it is with the Visual Studio IDE not properly updating it's GUI to reflect changes you make in the code?
                Infact yes. But, you will require to take control of IDE behaviour though your program, and it is the way that it is done in the case of customization for custom controls. So isn't there anybody who could help?

                Comment

                Working...