I have a custom button control that compares the user security level to the
buttons security level property. If the user level is greater than the
button level, then the button is enabled, else it is disabled. Now for the
three questions:
1) I tried to retrieve the buttons security level property during the
buttons constructor, but it can't get the actual value assigned to that
button until sometime after the contructor finishes. Is there any way to get
that value during the buttons constructor?
2) Then I moved the logic to disable the button to the property SET method.
The problem with this, is that if the security is set high enough to disable
the button, then it shows up in the designer as disabled, and I can not get
back to the buttons properites to change the security value again. Is there
some way to flag the code to not perform some lines of code if it is in
designer mode?
3) I also tried to put it in the OnPaint property, but then it just went
into an infinite loop. It must automatically call the OnPaint property if
the button is disabled?