0

I've recently been trying out editors like an ace editor on Webview2, since cefsharp is very power-hungry. My problem is that I seem to not find a single way as to how to get the text inside the editor with C# code, there seem to be no functions included, and I've been researching for about a day now and I have not found any results.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
arad
  • 1

1 Answers1

1

Try using the ace api, pretty sure it has a GetText function. Edit,

You can use a function like this to get the text and print it to a textbox:

// Note to you idk.xyz, use sx.Execute(EditorText);
String EditorText = Json.Decode(await 
Editor.ExecuteScriptAsync("GetText();"));
// The line below just proves that it gets the text in the ace editor.
aaaa.Text = EditorText;

I will link a project also that has an example in it: https://anonfiles.com/f7z9Lby3u6/testts_rar

Edit: Thanks for upvote ❤

Ultimate
  • 43
  • 1
  • 11