Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: How to simulate Enter with Shift + Enter

$
0
0

Hi,
Thanx for your reply. Sorry for the long long delay. I tried your code and it worked like a charm. There was only a problem with the Cursor position, that i solved. I am posting the code here for reference…

It is in C#

private void htmlDesigner_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                C1.Win.C1Editor.C1TextRange range = htmlDesigner.CreateRange(htmlDesigner.SelectionStart, 0);
                int offset = htmlDesigner.SelectionStart;
                range.XmlText = "<br/>";
                offset = offset + range.Text.Length;
                htmlDesigner.SelectionStart = offset; 
                htmlDesigner.Select(offset, 0);
                e.Handled = true;
            }
        }

Thanx for help.

Regards.


Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>