From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get a .NET control to generate events

Solved!
Go to solution

I can't get a RichTextBox .NET control to generate any events.  I am trying to trap the event where a user changes the text inside the RTF box, but I cannot get the callback VI to be executed.

 

The control is 'Setup'

main VI.png

 

The callback is simply supposed to add onto the queue (producer-consumer model) for the consumer to react to:

callback VI.png

 

but I can't even get the callback code to execute no matter the event I register (shown above as 'Enter', but I've tried 'KeyPress', 'ModifiedChanged', etc. with no change to performance).

 

Am I missing something??

0 Kudos
Message 1 of 7
(3,362 Views)

Does the Register Event Callback node throw an error?

It seems that you haven't wired up something on the error out and if you have automatic error handling diabled, you will not get notified....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(3,360 Views)

No errors.  I had it wired up earlier to ensure that the code was executing when I expected it and didn't get any problems. 

 

Just verified.  No complaints from the Callback Registration node.

0 Kudos
Message 3 of 7
(3,356 Views)

@thisisnotadream wrote:
[...] no matter the event I register (shown above as 'Enter', but I've tried 'KeyPress', 'ModifiedChanged', etc. with no change to performance).

 

Am I missing something??


Obviously, you have bad luck in choosing "compatible" events....

I confirm that Enter does not trigger the callback, however MouseEnter does.

 

I assume that some events are only triggered if the parent window is also created in .NET or work different as you'd expect them to do (regarding when the event occurs).

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 7
(3,348 Views)

That wouldn't normally shock me to hear that...however, I still get nothing. 

 

I get the same 'nothing' results when running the attached code.  When you execute, do you get the message popup from the callback that I would expect?

0 Kudos
Message 5 of 7
(3,342 Views)
Solution
Accepted by topic author thisisnotadream

Having your code running in LV 2015 i don't get a message popup. However, if i remove your callback VI and create a new one, it works.

It seems that something is wrong with your callback VI itself.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 6 of 7
(3,337 Views)

THAT'S IT!!!

 

I borrowed that VI online before I realized you could just right-click on the node.  When I just let LV generate the VI, it works.  Thanks!

0 Kudos
Message 7 of 7
(3,333 Views)