Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

richtextbox and delete key

3 REPLIES 3
Reply
Message 1 of 4
phildebrandt
614 Views, 3 Replies

richtextbox and delete key

I wrote a routine that uses a richtextbox to allow the user to enter formatted text. However for some reason it doesn't capture the delete key (a character is not deleted). THe macro just lets it fall through to Revit which starts the erase command. I've tried setting the KeyPreview of the window form to TRUE but this had no affect.

 

If I create a simple windows app with a richtextbox I notice the default behaviour is to capture the delete key and delete the character. So I'm thinking there is something in the Revit API that is altering this behaviour.

 

Does anyone have any ideas how to make the delete key work?

3 REPLIES 3
Message 2 of 4
RevitArkitek
in reply to: phildebrandt

Did you ever figure this out?  I have a modeless form with a datagridview and while editing text in a cell, when Delete is pressed (to remove highlighted text), Revit starts the Delete command or deletes an element that is selected.  I tried capturing the Delete key in a KeyDown event but does not work.  Thanks.

Message 3 of 4
phildebrandt
in reply to: RevitArkitek

No I didn't.

----
Paul
Message 4 of 4

In case others stumble on this as well. One solution to this issue is to start your form/window in a separate thread. Guidance for that is given at the following links

 

https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/threading-model#multiple-windows-mult... 

http://reedcopsey.com/2011/11/28/launching-a-wpf-window-in-a-separate-thread-part-1/

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community