Is it possible to detect when text is pasted into the textbox?

0
0

Is there a way to detect when user has pasted text into the textbox?  I don’t see any obvious events.

In Winforms, this was possible by subclassing WM_PASTE in WndProc, but obviously that’s not possible in WiseJ.

P.S. Using WiseJ 2.2.x

 

 

  • You must to post comments
2
1

Hi Matthew,

You can add a “paste” event listener for your TextBox widget.

You can do it by adding

this.getContentElement().addListener('paste',(e)=>{ this.fireWidgetEvent("paste",e); })

to the InitScript property of your textbox, then you’ll need to handle the “WidgetEvent”, it should look like this:

private void textBox1_WidgetEvent(object sender, WidgetEventArgs e)
{
if(e.Type == "paste")
{
AlertBox.Show("Hi");
}
}

HTH,
Alaa

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.