I have a problem with an UltraTextEditor, but I can't figure out what the problem is.. I start with it disabled, and the when the user click Update, all the controls on the form get enabled, including the UltraTextEditor. The problem is that this mechanism works fine if the Editor is not set up as multiline. When I try set up Multiline = true, the editor becomes disabled no matter what I do.
It's kinda like this:
editor.Enabled = false;
editor.multiline = true;
Then when I hit Update, I change the properties like this:
if(editor.Multiline)
editor.ReadOnly = not editor.Enabled;
What could be wrong? Thanks
I have a class - TextEditorField that basically is a wrapper for the UltraTextEditor. It has property, FieldEnabled that sets the Enabled property like this:
define public property FieldEnabled as logical
get.
set (plEnabled as logical):
FieldEnabled = plEnabled.
/* when it's a readonly field, always show it as readonly, it will never be enabled */
if FieldReadOnly then
do:
this-object:ReadOnly = true.
end.
else
/* when multi line: ReadOnly instead of Enabled so that the field can be scrolled */
if FieldMultiLine then
do: this-object:ReadOnly = not plEnabled.
this-object:Enabled = plEnabled.
end set.
My UltraTextEditor is multiline, so FieldMultiline is true when I set FieldEnabled = true (I start with FieldEnabled = false, then when I press Update i try to set FieldEnabled = true but my UltraTextEditor remains disabled). I can't figure out what's wrong, is there a connection between ReadOnly property of the editor and the Enabled property? So, the ReadOnly prop will be false after I press Update, and Enabled = true but I still see my UltraTextEditor disabled
The likeliest explanation is that the Enabled property is being inadvertantly set to false. You can handle the EnabledChanged event and put a breakpoint in the handler to easily debug changes to the property value, or if you like you can post a simple sample here and we can take a look and let you know why.