Odd Cursor Behaviour

D

Dirk Goldgar

Mr. B said:
This was a strang one.


I got curious and scanned this thread, and while I was mystified at first,
it seems to me that the behavior is actually to be expected. Even though
you have set the control as disabled at design time, when the
conditional-formatting expression evaluates to True, it applies *all* the
formatting attributes that part of the CF instruction. One of those is the
Enabled attribute, so if you don't set that attribute to False (disabled) in
the CF instruction, the application of the formatting attributes is going to
enable the control.

The same thing happens if, say, you set a control's FontWeight property to
Bold at design time, and then set up a conditional-formatting instruction to
set its ForeColor to Red under some conditions. If that instruction doesn't
also specify the Bold attribute, then when the necessary conditions are met,
the control will have its forecolor set to red all right, but it will no
longer be bolded.

I'd never noticed that before, because I never applied conditional
formatting to any control whose other properties were not defaults.
 
M

Mr. B

Hi, Dirk.

I too was also kinda surprised by the behavior of the conditional formatting
until I actually did some testing. I am not really that big on using this
feature, but wanted to know more about the issues that wer being experienced
by the OP.

The only thing that really surprised me during my testing was that if I set
the Disabled property to false first, then the Font color and other
formatting would be applied and the value in the control would not be
selectable. However, if I tied to set the font and other properties first
and then tried to apply the Enabled property to No the value in the control
would still be selectable. I would have thought that if the Enabled property
was set to No any time, the value would not be selectable.

Thanks for your thoughts and input on this issue.

Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm
 
D

Dirk Goldgar

Mr. B said:
I am not really that big on using this
feature, but wanted to know more about the issues that wer being
experienced
by the OP.

I prefer not to use it, because it chews up machine cycles like crazy, for
what is often pure cosmetics. Still, sometimes it's necessary to fulfill a
client requirement. I'd use it a lot more, though, if you could use it to
set the Visible property conditionally.
The only thing that really surprised me during my testing was that if I
set
the Disabled property to false first, then the Font color and other
formatting would be applied and the value in the control would not be
selectable. However, if I tied to set the font and other properties first
and then tried to apply the Enabled property to No the value in the
control
would still be selectable. I would have thought that if the Enabled
property
was set to No any time, the value would not be selectable.

My guess it it has to do with which condition is evaluated and applied last.
From your description, it seems like they aren't necessarily applied in the
order they're created. I didn't test that, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top