PC Review


Reply
Thread Tools Rate Thread

Delete key in form region textbox deleting email instead

 
 
Mark B
Guest
Posts: n/a
 
      19th Oct 2009
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.

 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      19th Oct 2009
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" <(E-Mail Removed)> wrote in message
news:u5vY%(E-Mail Removed)...
> 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.


 
Reply With Quote
 
 
 
 
Mark B
Guest
Posts: n/a
 
      20th Oct 2009
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]" <(E-Mail Removed)> wrote in message
news:%23$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:u5vY%(E-Mail Removed)...
>> 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.

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Form Region,"IPM".note.microsoft conversation.Region Alex Microsoft Outlook Contacts 1 7th Jun 2009 09:59 PM
Region visible in another Region? Brian Basquille Microsoft C# .NET 2 7th Feb 2005 06:05 PM
Examples using Region and/or Region.Intersect? Brian Microsoft C# .NET 3 17th Dec 2004 03:05 PM
region - end region =?Utf-8?B?Z3V5?= Microsoft VB .NET 3 22nd Oct 2004 12:38 PM
region 2 dvd wont play on dvd player region 2 in win xp John Windows XP New Users 2 14th Dec 2003 02:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:43 PM.