A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Delete key in form region textbox deleting email instead



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 19th 09, 12:59 PM posted to microsoft.public.outlook.program_addins
Mark B[_2_]
external usenet poster
 
Posts: 93
Default Delete key in form region textbox deleting email instead

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.

Ads
  #2  
Old October 19th 09, 03:29 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Delete key in form region textbox deleting email instead

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.

--
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


"Mark B" wrote in message
...
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.


  #3  
Old October 20th 09, 05:07 AM posted to microsoft.public.outlook.program_addins
Mark B[_2_]
external usenet poster
 
Posts: 93
Default Delete key in form region textbox deleting email instead

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.


"Ken Slovak - [MVP - Outlook]" wrote in message
...
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.

--
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


"Mark B" wrote in message
...
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.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Country/Region info DarylMB Outlook - Using Contacts 1 August 4th 09 08:21 PM
The Form Region,"IPM".note.microsoft conversation.Region Alex Outlook - Using Contacts 1 June 7th 09 09:59 PM
form with variable/flexible input textbox David Chang Outlook and VBA 2 December 5th 06 02:13 PM
deleting email in outlook, freezes before i can delete Sherrie Outlook - General Queries 2 August 14th 06 08:39 PM
cant overtype on custom form textbox Sydney Outlook - Using Forms 18 April 7th 06 04:58 AM


All times are GMT +1. The time now is 08:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.