Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / October 2009

Tip: Looking for answers? Try searching our database.

Delete key in form region textbox deleting email instead

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark B - 19 Oct 2009 12:59 GMT
OL2007, VSTO C#

I have a number spinner in a form region. If the user tries to delete some
text in it with the delete key on the keyboard, Outlook instead has been
deleting the email.

If have tried to intercept the following events to no avail:

bool nonNumberEntered = false;

 private void numericUpDownCustomNumber_KeyDown(object sender, KeyEventArgs
e)
       {

           nonNumberEntered = false;
           if (e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back)
           {
               nonNumberEntered = true;
           }
       }

       private void numericUpDownCustomNumber_KeyPress(object sender,
KeyPressEventArgs e)
       {
           if (nonNumberEntered == true)
           {
               // Stop the character from being entered into the control
since it is a delete keypress.
               e.Handled = true;
           }

       }

If anyone knows a way I'd appreciate it. Worst case I thought I could
temporarily enable a delete confirmation popup but can't see that Outlook
has that option.
Ken Slovak - [MVP - Outlook] - 19 Oct 2009 15:29 GMT
Is this happening when the item is opened, or only when it's being view in
the reading pane? If the reading pane that's a known bug in form regions and
I've never seen a successful workaround other than locking the controls when
the item is being displayed in the reading pane.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm

> OL2007, VSTO C#
>
[quoted text clipped - 32 lines]
> temporarily enable a delete confirmation popup but can't see that Outlook
> has that option.
Mark B - 20 Oct 2009 05:07 GMT
Only when being viewed in the reading pane.

The only way I could think of working around it is to use some sort of brute
force API call to disable the delete key on the keyboard when the spinner
gets focus and release it again when it loses focus.

I'll attempt to research that.

> Is this happening when the item is opened, or only when it's being view in
> the reading pane? If the reading pane that's a known bug in form regions
[quoted text clipped - 37 lines]
>> temporarily enable a delete confirmation popup but can't see that Outlook
>> has that option.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.