Is there an easy/standard way of limiting an UltraFormattedTextEditor control to a single line (no newlines)?
The UltraTextEditor has a Multiline true/false property, but I don't see the equivalent for UltraFormattedTextEditor.
Thanks,
Sean.
Hi Sean,
If there's no Multiline property, then I don't see any way to do this. You should Submit a feature request to Infragistics.
Hi Sean:
I have the same Problem. My solve was follow (Code-Snippet):Is not perfect, may it's work ....Donaldpublic LookupControl(){ InitializeComponent();
// uft_Lookup is the UltraFormattedTextEditor-Control
uft_Lookup.TextChanged += new EventHandler(OnLookupTextChanged);
uft_Lookup.KeyDown += new KeyEventHandler(OnLookupKeyDown);
uft_Lookup.KeyPress += new KeyPressEventHandler(OnLookupKeyPress);
uft_Lookup.Text = "";
uft_Lookup.Value = "";
uft_Lookup.GotFocus += delegate { OnLookupGotFocus(); };
uft_Lookup.LostFocus += delegate { OnLookupLostFocus(); };
cmd_Lookup.Click += new EventHandler(OnLookupClick);
}
// Handle the KeyDown event to determine the type// of character entered into the control.
private void OnLookupKeyDown(object sender, KeyEventArgs e)
{
// Initialize the flag to false.
mReturnEntered = false;
if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Enter)
mReturnEntered = true;
// This event occurs after the KeyDown event and can be used to prevent
// characters from entering the control.
private void OnLookupKeyPress(object sender, KeyPressEventArgs e)
// Check for the flag being set in the KeyDown event.
if (mReturnEntered)
// Stop the character from being entered into
// the control since it is non-numerical.
e.Handled = true;
private void OnLookupTextChanged(object sender, EventArgs e)
if (uft_Lookup.Text.Contains(Environment.NewLine))
Text = uft_Lookup.Text.Substring(0,
uft_Lookup.Text.IndexOf(Environment.NewLine));
}}