RBNUBE wrote:
>I wouldn't put a beep in the paint event.
Hey, it's a great Stethoscope ;-)
Works great when debugging mouse movement boundary testing
>
>Instead, try something like this:
>
> If Me.Enabled then
> g.DrawPicture Image35, 0, 0
> End If
Hang had in shame :-(
I had built up so much debugging code so that the paint event firing
when the parent state changes was not seen. After cleaning up all
that mess it's now doing as it should.
However, the Canvas does NOT get disabled when its parent does, a
GroupBox in my case. I even have code in the window that specifically
sets the GroupBox as my custom controls parent, just to be sure. So,
in this case your code would not work for the parent case. I did
something like this:
// In case I have no parent
dim meOff as Boolean = Not Me.Enabled
// In case I do have a parent
if Me.Parent <> Nil Then
if Me.Enabled And (Not Me.Parent.Enabled) Then meOff = True
end if
if me Off Then
g.ForeColor = DisabledTextColor( )
else
g.ForeColor = myForeColor
end if
This now works.
>When I do this, it works fine. However, depending on everything else that is
>going on in your ap, you might not be so lucky.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>