Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Attribute [RefreshProperties(RefreshProperties.Repaint)] doesn't appear to work as expected. What am I doing wrong?

$
0
0

I'm writing a custom control based on Control.

It has several properties that force a repaint and most my property coding is similar to the following.

public string MinText
    {
      get { return _minText; }
      set
      {
        if (value == null) value = "";
        _minText = value; Invalidate();
      }
    }

After googling, I discovered the RefreshProperties attribute and tried it as follows. It didn't work.

Is there something else I should be doing. If it did work it would save so much typing if I can use it with auto properties

[RefreshProperties(RefreshProperties.Repaint)]
    public Color BandColorLow{get;set;}


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>