473,719 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

recompiling VS NET WinForms app with VS NET 2003 causing serious problems.

We just recently moved one of our major c# apps from VS Net 2002 to VS Net
2003. At first things were looking ok, now problems are starting to
appear.

So far ...

(1) ComboBox.Select edValue = db_value;

If the db_value was not included in the ComboBox value list the
ComboBox.Select edIndex used to return -1, Now the very same code is
returning 0, we are checking for -1. We use this trait quite a bit and I
want to know what's going on before weeding it out of 100,000 lines of C#
across 24 separate user controls.

(2) command button 'Access Keys' or Alt-character ...

specified by inserting & into the button text value have begun acting
abnormal. We have a main form that contains 24 user controls each with an
'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002 all
of these keys worked fine. After compiling with VS Net 2003 the ALT-A,
ALT-U & ALT-D buttons work on about half of the controls and refuse to work
on the rest. No clear indication as to why. The data entry staff is
standing outside my cube with Pitch Forks and Axes !!!

What's going on here ???? (Besides not looking carefully enough before we
leaped.)
Is there a FAQ or message thread for problems with VS Net 2002 to VS Net
2003 conversions somewhere?
Near death experiences like this are extremely unplesant.

Thanks in advance.

Barry
Oregon
Nov 15 '05 #1
10 2410
More information.

It turns out pressing command button 'Access Keys' or Alt-character on one
control seems to be randomly triggering the corresponding command button on
another user control contained by the form. i.e. ALT-U on UserControl1 is
triggering the &Update command button on UserControl12.

How does one prevent this type of UserControl 'cross over' when numerous
user controls are contained by the same form?

Thanks in advance.

Barry
Oregon

P.S. I've changed the combobox code (see below) in a couple of instances
from

ComboBox.Select edValue = dbValueString;
(if ComboBox.Select edIndex == -1) TO (if ComboBox.Select edIndex < 1)

in an attempt to determine if dbValueString matches a value in the ComboBox
display List. This change seems to be working for the time being.


"BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us> wrote in message
news:#Q******** ******@TK2MSFTN GP09.phx.gbl...
We just recently moved one of our major c# apps from VS Net 2002 to VS Net
2003. At first things were looking ok, now problems are starting to
appear.

So far ...

(1) ComboBox.Select edValue = db_value;

If the db_value was not included in the ComboBox value list the
ComboBox.Select edIndex used to return -1, Now the very same code is
returning 0, we are checking for -1. We use this trait quite a bit and I
want to know what's going on before weeding it out of 100,000 lines of C#
across 24 separate user controls.

(2) command button 'Access Keys' or Alt-character ...

specified by inserting & into the button text value have begun acting
abnormal. We have a main form that contains 24 user controls each with an
'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002 all
of these keys worked fine. After compiling with VS Net 2003 the ALT-A,
ALT-U & ALT-D buttons work on about half of the controls and refuse to work on the rest. No clear indication as to why. The data entry staff is
standing outside my cube with Pitch Forks and Axes !!!

What's going on here ???? (Besides not looking carefully enough before we
leaped.)
Is there a FAQ or message thread for problems with VS Net 2002 to VS Net
2003 conversions somewhere?
Near death experiences like this are extremely unplesant.

Thanks in advance.

Barry
Oregon

Nov 15 '05 #2
Hi Barry,

Based on my test, when you assign a "value" to ComboBox.Select edValue, if
this value is in the list of the combobox, SelectedIndex is set to its
index. Otherwise, the SelectedIndex property keeps unchanged. As for the
'Access Keys', do you have duplicate Access Keys defined in the
application?

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
Subject: recompiling VS NET WinForms app with VS NET 2003 causing serious problems.Date: Wed, 4 Feb 2004 11:30:58 -0800
Lines: 40
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA07.phx. gbl!TK2MSFTNGXA 0
6.phx.gbl!TK2MS FTNGXA05.phx.gb l!TK2MSFTNGP08. phx.gbl!TK2MSFT NGP09.phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2182 15
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

We just recently moved one of our major c# apps from VS Net 2002 to VS Net
2003. At first things were looking ok, now problems are starting to
appear.

So far ...

(1) ComboBox.Select edValue = db_value;

If the db_value was not included in the ComboBox value list the
ComboBox.Selec tedIndex used to return -1, Now the very same code is
returning 0, we are checking for -1. We use this trait quite a bit and I
want to know what's going on before weeding it out of 100,000 lines of C#
across 24 separate user controls.

(2) command button 'Access Keys' or Alt-character ...

specified by inserting & into the button text value have begun acting
abnormal. We have a main form that contains 24 user controls each with an
'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002 all
of these keys worked fine. After compiling with VS Net 2003 the ALT-A,
ALT-U & ALT-D buttons work on about half of the controls and refuse to work
on the rest. No clear indication as to why. The data entry staff is
standing outside my cube with Pitch Forks and Axes !!!

What's going on here ???? (Besides not looking carefully enough before we
leaped.)
Is there a FAQ or message thread for problems with VS Net 2002 to VS Net
2003 conversions somewhere?
Near death experiences like this are extremely unplesant.

Thanks in advance.

Barry
Oregon


Nov 15 '05 #3
Felix,

Thanks for the quick response ... our attempt to move to VS Net 2003 is
definitely stopped until we can correct these problems.

1st - Please understand that this data entry application has been WORKING
PROBLEM FREE FOR OVER A YEAR when compiled with VS Net 2002. These problems
appeared only when we used VS Net 2003 to recompile the application. This
is a very large and complex data entry application supporting the State of
Oregon's Water Right Tracking system.

The application has a Main Form that contains 24 user controls. EACH USER
CONTROL HAS an
'&Add', '&Update' and '&Delete' button. So the answer to your question is
'yes', the Main Form contains 24 '&Update' buttons, with each User Control
containing a single '&Update' button. However, previously in Net 2002
Access Keys behaved as if each User Control was an application unto itself.
Net 2003 seems to have somehow broken that functionality.

Until we recompiled the app using VS Net 2003, pressing ALT-U within any
control activated the control's '&Update' button. Now we have found that
pressing ALT-U in some controls activates the '&Update' button in a
completely different control. This is a REALLY BAD THING. To add to the
confusion, the Access Keys work correctly and consistently in some controls
and consistently fail (while activating the access key in other completely
unrelated user controls).

We have have reverted to the Net 2002 Version of the app which works
correctly. i.e. Pressing ALT-U within in a control activates that
control's '&Update' button. The combobox issue also works correctly with
the Net 2002 version.

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:hw******** ******@cpmsftng xa07.phx.gbl...
Hi Barry,

Based on my test, when you assign a "value" to ComboBox.Select edValue, if
this value is in the list of the combobox, SelectedIndex is set to its
index. Otherwise, the SelectedIndex property keeps unchanged. As for the
'Access Keys', do you have duplicate Access Keys defined in the
application?

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
Subject: recompiling VS NET WinForms app with VS NET 2003 causing serious problems.
Date: Wed, 4 Feb 2004 11:30:58 -0800
Lines: 40
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path:

cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA07.phx. gbl!TK2MSFTNGXA 0 6.phx.gbl!TK2MS FTNGXA05.phx.gb l!TK2MSFTNGP08. phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2182 15X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

We just recently moved one of our major c# apps from VS Net 2002 to VS Net2003. At first things were looking ok, now problems are starting to
appear.

So far ...

(1) ComboBox.Select edValue = db_value;

If the db_value was not included in the ComboBox value list the
ComboBox.Selec tedIndex used to return -1, Now the very same code is
returning 0, we are checking for -1. We use this trait quite a bit and Iwant to know what's going on before weeding it out of 100,000 lines of C#
across 24 separate user controls.

(2) command button 'Access Keys' or Alt-character ...

specified by inserting & into the button text value have begun acting
abnormal. We have a main form that contains 24 user controls each with an'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002 allof these keys worked fine. After compiling with VS Net 2003 the ALT-A,
ALT-U & ALT-D buttons work on about half of the controls and refuse to workon the rest. No clear indication as to why. The data entry staff is
standing outside my cube with Pitch Forks and Axes !!!

What's going on here ???? (Besides not looking carefully enough before weleaped.)
Is there a FAQ or message thread for problems with VS Net 2002 to VS Net
2003 conversions somewhere?
Near death experiences like this are extremely unplesant.

Thanks in advance.

Barry
Oregon

Nov 15 '05 #4
Felix,

This situation is so critical that I've started a case with MS Tech support.
I've got a partial solution so far the problem has not been completely
resolved. I'll post to this string with the resolution when the problem is
resolved. Thanks.

Barry
Oregon
"BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us> wrote in message
news:OW******** ******@TK2MSFTN GP09.phx.gbl...
Felix,

Thanks for the quick response ... our attempt to move to VS Net 2003 is
definitely stopped until we can correct these problems.

1st - Please understand that this data entry application has been WORKING
PROBLEM FREE FOR OVER A YEAR when compiled with VS Net 2002. These problems appeared only when we used VS Net 2003 to recompile the application. This
is a very large and complex data entry application supporting the State of
Oregon's Water Right Tracking system.

The application has a Main Form that contains 24 user controls. EACH USER
CONTROL HAS an
'&Add', '&Update' and '&Delete' button. So the answer to your question is 'yes', the Main Form contains 24 '&Update' buttons, with each User Control containing a single '&Update' button. However, previously in Net 2002
Access Keys behaved as if each User Control was an application unto itself. Net 2003 seems to have somehow broken that functionality.

Until we recompiled the app using VS Net 2003, pressing ALT-U within any
control activated the control's '&Update' button. Now we have found that pressing ALT-U in some controls activates the '&Update' button in a
completely different control. This is a REALLY BAD THING. To add to the
confusion, the Access Keys work correctly and consistently in some controls and consistently fail (while activating the access key in other completely
unrelated user controls).

We have have reverted to the Net 2002 Version of the app which works
correctly. i.e. Pressing ALT-U within in a control activates that
control's '&Update' button. The combobox issue also works correctly with the Net 2002 version.

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:hw******** ******@cpmsftng xa07.phx.gbl...
Hi Barry,

Based on my test, when you assign a "value" to ComboBox.Select edValue, if
this value is in the list of the combobox, SelectedIndex is set to its
index. Otherwise, the SelectedIndex property keeps unchanged. As for the
'Access Keys', do you have duplicate Access Keys defined in the
application?

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
Subject: recompiling VS NET WinForms app with VS NET 2003 causing serious
problems.
Date: Wed, 4 Feb 2004 11:30:58 -0800
Lines: 40
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path:

cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA07.phx. gbl!TK2MSFTNGXA 0

6.phx.gbl!TK2MS FTNGXA05.phx.gb l!TK2MSFTNGP08. phx.gbl!TK2MSFT NGP09.phx.gblXref: cpmsftngxa07.ph x.gbl

microsoft.publi c.dotnet.langua ges.csharp:2182 15X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

We just recently moved one of our major c# apps from VS Net 2002 to VS Net2003. At first things were looking ok, now problems are starting to
appear.

So far ...

(1) ComboBox.Select edValue = db_value;

If the db_value was not included in the ComboBox value list the
ComboBox.Selec tedIndex used to return -1, Now the very same code is
returning 0, we are checking for -1. We use this trait quite a bit and I
want to know what's going on before weeding it out of 100,000 lines of
C#across 24 separate user controls.

(2) command button 'Access Keys' or Alt-character ...

specified by inserting & into the button text value have begun acting
abnormal. We have a main form that contains 24 user controls each with

an'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002 allof these keys worked fine. After compiling with VS Net 2003 the ALT-A,
ALT-U & ALT-D buttons work on about half of the controls and refuse to workon the rest. No clear indication as to why. The data entry staff is
standing outside my cube with Pitch Forks and Axes !!!

What's going on here ???? (Besides not looking carefully enough before weleaped.)
Is there a FAQ or message thread for problems with VS Net 2002 to VS Net2003 conversions somewhere?
Near death experiences like this are extremely unplesant.

Thanks in advance.

Barry
Oregon


Nov 15 '05 #5
Thanks for the information. I will take a further look into this issue and
update you if I find anything useful.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
References: <#Q************ **@TK2MSFTNGP09 .phx.gbl> <hw************ **@cpmsftngxa07 .phx.gbl>
<OW************ **@TK2MSFTNGP09 .phx.gbl>Subject: Re: recompiling VS NET WinForms app with VS NET 2003 causing serious problems.Date: Thu, 5 Feb 2004 16:59:57 -0800
Lines: 153
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <#j************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
.phx.gbl!TK2MSF TNGP09.phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2186 32
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

Felix,

This situation is so critical that I've started a case with MS Tech support.I've got a partial solution so far the problem has not been completely
resolved. I'll post to this string with the resolution when the problem is
resolved. Thanks.

Barry
Oregon
"BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us> wrote in message
news:OW******* *******@TK2MSFT NGP09.phx.gbl.. .
Felix,

Thanks for the quick response ... our attempt to move to VS Net 2003 is
definitely stopped until we can correct these problems.

1st - Please understand that this data entry application has been WORKING
PROBLEM FREE FOR OVER A YEAR when compiled with VS Net 2002. These

problems
appeared only when we used VS Net 2003 to recompile the application. This
is a very large and complex data entry application supporting the State of Oregon's Water Right Tracking system.

The application has a Main Form that contains 24 user controls. EACH USER CONTROL HAS an
'&Add', '&Update' and '&Delete' button. So the answer to your question

is
'yes', the Main Form contains 24 '&Update' buttons, with each User

Control
containing a single '&Update' button. However, previously in Net 2002
Access Keys behaved as if each User Control was an application unto

itself.
Net 2003 seems to have somehow broken that functionality.

Until we recompiled the app using VS Net 2003, pressing ALT-U within any
control activated the control's '&Update' button. Now we have found

that
pressing ALT-U in some controls activates the '&Update' button in a
completely different control. This is a REALLY BAD THING. To add to the
confusion, the Access Keys work correctly and consistently in some

controls
and consistently fail (while activating the access key in other completely unrelated user controls).

We have have reverted to the Net 2002 Version of the app which works
correctly. i.e. Pressing ALT-U within in a control activates that
control's '&Update' button. The combobox issue also works correctly

with
the Net 2002 version.

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:hw******** ******@cpmsftng xa07.phx.gbl...
> Hi Barry,
>
> Based on my test, when you assign a "value" to ComboBox.Select edValue,if > this value is in the list of the combobox, SelectedIndex is set to its
> index. Otherwise, the SelectedIndex property keeps unchanged. As for the > 'Access Keys', do you have duplicate Access Keys defined in the
> application?
>
> Regards,
>
> Felix Wu
> =============
> This posting is provided "AS IS" with no warranties, and confers no

rights.
>
>
> --------------------
> >Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
> >From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
> >Subject: recompiling VS NET WinForms app with VS NET 2003 causingserious > problems.
> >Date: Wed, 4 Feb 2004 11:30:58 -0800
> >Lines: 40
> >X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
> >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
> >Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
> >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
> >NNTP-Posting-Host: 159.121.113.234
> >Path:
>

cpmsftngxa07.p hx.gbl!cpmsftng xa10.phx.gbl!TK 2MSFTNGXA07.phx .gbl!TK2MSFTNGX A

0
>6.phx.gbl!TK2M SFTNGXA05.phx.g bl!TK2MSFTNGP08 .phx.gbl!TK2MSF TNGP09.phx.gbl > >Xref: cpmsftngxa07.ph x.gbl

microsoft.publi c.dotnet.langua ges.csharp:2182 15
> >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
> >
> >We just recently moved one of our major c# apps from VS Net 2002 to VS

Net
> >2003. At first things were looking ok, now problems are starting to
> >appear.
> >
> >So far ...
> >
> >(1) ComboBox.Select edValue = db_value;
> >
> >If the db_value was not included in the ComboBox value list the
> >ComboBox.Selec tedIndex used to return -1, Now the very same code is
> >returning 0, we are checking for -1. We use this trait quite a bitand
I
> >want to know what's going on before weeding it out of 100,000 lines of

C# > >across 24 separate user controls.
> >
> >(2) command button 'Access Keys' or Alt-character ...
> >
> >specified by inserting & into the button text value have begun acting
> >abnormal. We have a main form that contains 24 user controls each with an
> >'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002

all
> >of these keys worked fine. After compiling with VS Net 2003 the
ALT-A, > >ALT-U & ALT-D buttons work on about half of the controls and refuse to

work
> >on the rest. No clear indication as to why. The data entry staff is
> >standing outside my cube with Pitch Forks and Axes !!!
> >
> >What's going on here ???? (Besides not looking carefully enough
before we
> >leaped.)
> >
> >
> >Is there a FAQ or message thread for problems with VS Net 2002 to VS

Net > >2003 conversions somewhere?
> >
> >
> >Near death experiences like this are extremely unplesant.
> >
> >Thanks in advance.
> >
> >Barry
> >Oregon
> >
> >
> >
>




Nov 15 '05 #6
Hi Barry,

I repro-ed the accesss key issue you mentioned. To resolve this problem,
you can override ProcessDialogCh ar in all your UserControls:

public class UserControl1 : System.Windows. Forms.UserContr ol
{
...
protected override bool ProcessDialogCh ar(char charCode)
{
if (charCode != ' ' && ProcessMnemonic (charCode)) return true;
return base.ProcessDia logChar(charCod e);
}
...
}
However, I am not able to repro SelectedIndex issue. It shows the same
behavior in both .NET Framework 1.0 and 1.1.

Actually, when you set a value to the SelectedValue property, combobox
searches its list and returns the index if the value is found, otherwise,
returns -1. This return value is set to the SelectedIndex property of the
control. Then, combobox needs to update the CurrencyManager .Position
property of the underlying datasource based on the SelectedIndex. However,
the Position will be adjusted to 0 if the SelectedIndex is less than 0.
After this, CurrencyManager updates the underlying datasource if it finds
that the current Position value (is adjusted "0" is this case) is different
from the previous Position value. During this process, CurrencyManager
will udpate the SelectedIndex to the current CurrencyManager .Position
value, that is, 0.

In a nutshell, if the current SelectedIndex is "0", SelectedIndex will
return -1 when you set an invaid value (the value that is not included in
the ComboBox value list ) to the SelectedValue property. If the current
SelectedIndex is not "0", it will return 0.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
References: <#Q************ **@TK2MSFTNGP09 .phx.gbl> <hw************ **@cpmsftngxa07 .phx.gbl>
<OW************ **@TK2MSFTNGP09 .phx.gbl>Subject: Re: recompiling VS NET WinForms app with VS NET 2003 causing serious problems.Date: Thu, 5 Feb 2004 16:59:57 -0800
Lines: 153
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <#j************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
.phx.gbl!TK2MSF TNGP09.phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2186 32
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

Felix,

This situation is so critical that I've started a case with MS Tech support.I've got a partial solution so far the problem has not been completely
resolved. I'll post to this string with the resolution when the problem is
resolved. Thanks.

Barry
Oregon
"BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us> wrote in message
news:OW******* *******@TK2MSFT NGP09.phx.gbl.. .
Felix,

Thanks for the quick response ... our attempt to move to VS Net 2003 is
definitely stopped until we can correct these problems.

1st - Please understand that this data entry application has been WORKING
PROBLEM FREE FOR OVER A YEAR when compiled with VS Net 2002. These

problems
appeared only when we used VS Net 2003 to recompile the application. This
is a very large and complex data entry application supporting the State of Oregon's Water Right Tracking system.

The application has a Main Form that contains 24 user controls. EACH USER CONTROL HAS an
'&Add', '&Update' and '&Delete' button. So the answer to your question

is
'yes', the Main Form contains 24 '&Update' buttons, with each User

Control
containing a single '&Update' button. However, previously in Net 2002
Access Keys behaved as if each User Control was an application unto

itself.
Net 2003 seems to have somehow broken that functionality.

Until we recompiled the app using VS Net 2003, pressing ALT-U within any
control activated the control's '&Update' button. Now we have found

that
pressing ALT-U in some controls activates the '&Update' button in a
completely different control. This is a REALLY BAD THING. To add to the
confusion, the Access Keys work correctly and consistently in some

controls
and consistently fail (while activating the access key in other completely unrelated user controls).

We have have reverted to the Net 2002 Version of the app which works
correctly. i.e. Pressing ALT-U within in a control activates that
control's '&Update' button. The combobox issue also works correctly

with
the Net 2002 version.

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:hw******** ******@cpmsftng xa07.phx.gbl...
> Hi Barry,
>
> Based on my test, when you assign a "value" to ComboBox.Select edValue,if > this value is in the list of the combobox, SelectedIndex is set to its
> index. Otherwise, the SelectedIndex property keeps unchanged. As for the > 'Access Keys', do you have duplicate Access Keys defined in the
> application?
>
> Regards,
>
> Felix Wu
> =============
> This posting is provided "AS IS" with no warranties, and confers no

rights.
>
>
> --------------------
> >Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
> >From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
> >Subject: recompiling VS NET WinForms app with VS NET 2003 causingserious > problems.
> >Date: Wed, 4 Feb 2004 11:30:58 -0800
> >Lines: 40
> >X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
> >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
> >Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
> >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
> >NNTP-Posting-Host: 159.121.113.234
> >Path:
>

cpmsftngxa07.p hx.gbl!cpmsftng xa10.phx.gbl!TK 2MSFTNGXA07.phx .gbl!TK2MSFTNGX A

0
>6.phx.gbl!TK2M SFTNGXA05.phx.g bl!TK2MSFTNGP08 .phx.gbl!TK2MSF TNGP09.phx.gbl > >Xref: cpmsftngxa07.ph x.gbl

microsoft.publi c.dotnet.langua ges.csharp:2182 15
> >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
> >
> >We just recently moved one of our major c# apps from VS Net 2002 to VS

Net
> >2003. At first things were looking ok, now problems are starting to
> >appear.
> >
> >So far ...
> >
> >(1) ComboBox.Select edValue = db_value;
> >
> >If the db_value was not included in the ComboBox value list the
> >ComboBox.Selec tedIndex used to return -1, Now the very same code is
> >returning 0, we are checking for -1. We use this trait quite a bitand
I
> >want to know what's going on before weeding it out of 100,000 lines of

C# > >across 24 separate user controls.
> >
> >(2) command button 'Access Keys' or Alt-character ...
> >
> >specified by inserting & into the button text value have begun acting
> >abnormal. We have a main form that contains 24 user controls each with an
> >'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002

all
> >of these keys worked fine. After compiling with VS Net 2003 the
ALT-A, > >ALT-U & ALT-D buttons work on about half of the controls and refuse to

work
> >on the rest. No clear indication as to why. The data entry staff is
> >standing outside my cube with Pitch Forks and Axes !!!
> >
> >What's going on here ???? (Besides not looking carefully enough
before we
> >leaped.)
> >
> >
> >Is there a FAQ or message thread for problems with VS Net 2002 to VS

Net > >2003 conversions somewhere?
> >
> >
> >Near death experiences like this are extremely unplesant.
> >
> >Thanks in advance.
> >
> >Barry
> >Oregon
> >
> >
> >
>




Nov 15 '05 #7
Felix,

THANKS for the info! Its very much appreciated. I've think we've corrected
the Combobox anomolie by checking for < 1 rather than == -1.

I'm working on integrating the ProcessDialogCh ar override.

I'll post back to the group with the results.

Again many THANKS !!

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:KK******** ******@cpmsftng xa07.phx.gbl...
Hi Barry,

I repro-ed the accesss key issue you mentioned. To resolve this problem,
you can override ProcessDialogCh ar in all your UserControls:

public class UserControl1 : System.Windows. Forms.UserContr ol
{
...
protected override bool ProcessDialogCh ar(char charCode)
{
if (charCode != ' ' && ProcessMnemonic (charCode)) return true;
return base.ProcessDia logChar(charCod e);
}
...
}
However, I am not able to repro SelectedIndex issue. It shows the same
behavior in both .NET Framework 1.0 and 1.1.

Actually, when you set a value to the SelectedValue property, combobox
searches its list and returns the index if the value is found, otherwise,
returns -1. This return value is set to the SelectedIndex property of the
control. Then, combobox needs to update the CurrencyManager .Position
property of the underlying datasource based on the SelectedIndex. However,
the Position will be adjusted to 0 if the SelectedIndex is less than 0.
After this, CurrencyManager updates the underlying datasource if it finds
that the current Position value (is adjusted "0" is this case) is different from the previous Position value. During this process, CurrencyManager
will udpate the SelectedIndex to the current CurrencyManager .Position
value, that is, 0.

In a nutshell, if the current SelectedIndex is "0", SelectedIndex will
return -1 when you set an invaid value (the value that is not included in
the ComboBox value list ) to the SelectedValue property. If the current
SelectedIndex is not "0", it will return 0.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
References: <#Q************ **@TK2MSFTNGP09 .phx.gbl> <hw************ **@cpmsftngxa07 .phx.gbl>
<OW************ **@TK2MSFTNGP09 .phx.gbl>
Subject: Re: recompiling VS NET WinForms app with VS NET 2003 causing

serious problems.
Date: Thu, 5 Feb 2004 16:59:57 -0800
Lines: 153
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <#j************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path:

cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8 phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2186 32
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

Felix,

This situation is so critical that I've started a case with MS Tech

support.
I've got a partial solution so far the problem has not been completely
resolved. I'll post to this string with the resolution when the problem isresolved. Thanks.

Barry
Oregon
"BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us> wrote in message
news:OW******* *******@TK2MSFT NGP09.phx.gbl.. .
Felix,

Thanks for the quick response ... our attempt to move to VS Net 2003 is
definitely stopped until we can correct these problems.

1st - Please understand that this data entry application has been WORKING PROBLEM FREE FOR OVER A YEAR when compiled with VS Net 2002. These

problems
appeared only when we used VS Net 2003 to recompile the application. This is a very large and complex data entry application supporting the State of Oregon's Water Right Tracking system.

The application has a Main Form that contains 24 user controls. EACH USER CONTROL HAS an
'&Add', '&Update' and '&Delete' button. So the answer to your questionis
'yes', the Main Form contains 24 '&Update' buttons, with each User

Control
containing a single '&Update' button. However, previously in Net 2002
Access Keys behaved as if each User Control was an application unto

itself.
Net 2003 seems to have somehow broken that functionality.

Until we recompiled the app using VS Net 2003, pressing ALT-U within
any control activated the control's '&Update' button. Now we have found

that
pressing ALT-U in some controls activates the '&Update' button in a
completely different control. This is a REALLY BAD THING. To add to the confusion, the Access Keys work correctly and consistently in some

controls
and consistently fail (while activating the access key in other completely unrelated user controls).

We have have reverted to the Net 2002 Version of the app which works
correctly. i.e. Pressing ALT-U within in a control activates that
control's '&Update' button. The combobox issue also works correctly

with
the Net 2002 version.

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:hw******** ******@cpmsftng xa07.phx.gbl...
> Hi Barry,
>
> Based on my test, when you assign a "value" to ComboBox.Select edValue,if
> this value is in the list of the combobox, SelectedIndex is set to
its > index. Otherwise, the SelectedIndex property keeps unchanged. As for the > 'Access Keys', do you have duplicate Access Keys defined in the
> application?
>
> Regards,
>
> Felix Wu
> =============
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
> --------------------
> >Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
> >From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
> >Subject: recompiling VS NET WinForms app with VS NET 2003 causing

serious
> problems.
> >Date: Wed, 4 Feb 2004 11:30:58 -0800
> >Lines: 40
> >X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
> >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
> >Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
> >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
> >NNTP-Posting-Host: 159.121.113.234
> >Path:
>

cpmsftngxa07.p hx.gbl!cpmsftng xa10.phx.gbl!TK 2MSFTNGXA07.phx .gbl!TK2MSFTNGX A
0 >

6.phx.gbl!TK2M SFTNGXA05.phx.g bl!TK2MSFTNGP08 .phx.gbl!TK2MSF TNGP09.phx.gbl
> >Xref: cpmsftngxa07.ph x.gbl
microsoft.publi c.dotnet.langua ges.csharp:2182 15
> >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
> >
> >We just recently moved one of our major c# apps from VS Net 2002 to VS Net
> >2003. At first things were looking ok, now problems are starting to > >appear.
> >
> >So far ...
> >
> >(1) ComboBox.Select edValue = db_value;
> >
> >If the db_value was not included in the ComboBox value list the
> >ComboBox.Selec tedIndex used to return -1, Now the very same code is
> >returning 0, we are checking for -1. We use this trait quite a bit

and
I
> >want to know what's going on before weeding it out of 100,000 lines ofC#
> >across 24 separate user controls.
> >
> >(2) command button 'Access Keys' or Alt-character ...
> >
> >specified by inserting & into the button text value have begun
acting > >abnormal. We have a main form that contains 24 user controls each

with an
> >'&Add', '&Update' and '&Delete' button. When compiled in VS Net 2002 all
> >of these keys worked fine. After compiling with VS Net 2003 the ALT-A, > >ALT-U & ALT-D buttons work on about half of the controls and refuse to work
> >on the rest. No clear indication as to why. The data entry staff is
> >standing outside my cube with Pitch Forks and Axes !!!
> >
> >What's going on here ???? (Besides not looking carefully enough before we
> >leaped.)
> >
> >
> >Is there a FAQ or message thread for problems with VS Net 2002 to VS

Net
> >2003 conversions somewhere?
> >
> >
> >Near death experiences like this are extremely unplesant.
> >
> >Thanks in advance.
> >
> >Barry
> >Oregon
> >
> >
> >
>


Nov 15 '05 #8
Welcome, Barry.

However, I am afraid that simply checking SelectedIndex < 1 is not enough.
Since SelectedIndex zero-based, what if the dbValueString happens to be the
same as the first value in the list?

One workaround is to check if the new value equals the first value in the
list when SelectedIndex is 0. For example:

DataRowView drv=(DataRowVie w)comboBox1.Ite ms[0];

....
comboBox1.Selec tedValue=newVal ;

if (comboBox1.Sele ctedIndex==-1 || (comboBox1.Sele ctedIndex==0 &&
(drv["colName"].ToString()!=ne wVal.ToString() )))
MessageBox.Show ("It's Invalid: " + newVal.ToString ());
else
MessageBox.Show ("It's Valid: " + newVal.ToString ());

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
References: <#Q************ **@TK2MSFTNGP09 .phx.gbl> <hw************ **@cpmsftngxa07 .phx.gbl>
<OW************ **@TK2MSFTNGP09 .phx.gbl>
<#j************ **@TK2MSFTNGP09 .phx.gbl>
<KK************ **@cpmsftngxa07 .phx.gbl>Subject: Re: recompiling VS NET WinForms app with VS NET 2003 causing serious problems.Date: Mon, 9 Feb 2004 08:06:17 -0800
Lines: 267
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <OT************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
.phx.gbl!TK2MSF TNGP10.phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2192 91
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

Felix,

THANKS for the info! Its very much appreciated. I've think we've correctedthe Combobox anomolie by checking for < 1 rather than == -1.

I'm working on integrating the ProcessDialogCh ar override.

I'll post back to the group with the results.

Again many THANKS !!

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:KK******* *******@cpmsftn gxa07.phx.gbl.. .
Hi Barry,

I repro-ed the accesss key issue you mentioned. To resolve this problem,
you can override ProcessDialogCh ar in all your UserControls:

public class UserControl1 : System.Windows. Forms.UserContr ol
{
...
protected override bool ProcessDialogCh ar(char charCode)
{
if (charCode != ' ' && ProcessMnemonic (charCode)) return true;
return base.ProcessDia logChar(charCod e);
}
...
}
However, I am not able to repro SelectedIndex issue. It shows the same
behavior in both .NET Framework 1.0 and 1.1.

Actually, when you set a value to the SelectedValue property, combobox
searches its list and returns the index if the value is found, otherwise,
returns -1. This return value is set to the SelectedIndex property of the
control. Then, combobox needs to update the CurrencyManager .Position
property of the underlying datasource based on the SelectedIndex. However,
the Position will be adjusted to 0 if the SelectedIndex is less than 0.
After this, CurrencyManager updates the underlying datasource if it finds
that the current Position value (is adjusted "0" is this case) is

different
from the previous Position value. During this process, CurrencyManager
will udpate the SelectedIndex to the current CurrencyManager .Position
value, that is, 0.

In a nutshell, if the current SelectedIndex is "0", SelectedIndex will
return -1 when you set an invaid value (the value that is not included in
the ComboBox value list ) to the SelectedValue property. If the current
SelectedIndex is not "0", it will return 0.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no

rights.


--------------------
>Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
>From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
>References: <#Q************ **@TK2MSFTNGP09 .phx.gbl>

<hw************ **@cpmsftngxa07 .phx.gbl>
<OW************ **@TK2MSFTNGP09 .phx.gbl>
>Subject: Re: recompiling VS NET WinForms app with VS NET 2003 causing

serious problems.
>Date: Thu, 5 Feb 2004 16:59:57 -0800
>Lines: 153
>X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
>Message-ID: <#j************ **@TK2MSFTNGP09 .phx.gbl>
>Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
>NNTP-Posting-Host: 159.121.113.234
>Path:

cpmsftngxa07.p hx.gbl!cpmsftng xa10.phx.gbl!TK 2MSFTNGXA05.phx .gbl!TK2MSFTNGP 0

8
phx.gbl!TK2MSFT NGP09.phx.gbl
>Xref: cpmsftngxa07.ph x.gblmicrosoft.publ ic.dotnet.langu ages.csharp:218 632 >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
>
>Felix,
>
>This situation is so critical that I've started a case with MS Tech

support.
>I've got a partial solution so far the problem has not been completely
>resolved. I'll post to this string with the resolution when the problemis >resolved. Thanks.
>
>Barry
>Oregon
>
>
>"BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us> wrote in message
>news:OW******* *******@TK2MSFT NGP09.phx.gbl.. .
>> Felix,
>>
>> Thanks for the quick response ... our attempt to move to VS Net 2003 is >> definitely stopped until we can correct these problems.
>>
>> 1st - Please understand that this data entry application has beenWORKING >> PROBLEM FREE FOR OVER A YEAR when compiled with VS Net 2002. These
>problems
>> appeared only when we used VS Net 2003 to recompile the application.

This
>> is a very large and complex data entry application supporting the State of
>> Oregon's Water Right Tracking system.
>>
>> The application has a Main Form that contains 24 user controls. EACH

USER
>> CONTROL HAS an
>> '&Add', '&Update' and '&Delete' button. So the answer to yourquestion >is
>> 'yes', the Main Form contains 24 '&Update' buttons, with each User
>Control
>> containing a single '&Update' button. However, previously in Net
2002 >> Access Keys behaved as if each User Control was an application unto
>itself.
>> Net 2003 seems to have somehow broken that functionality.
>>
>> Until we recompiled the app using VS Net 2003, pressing ALT-U withinany >> control activated the control's '&Update' button. Now we have found
>that
>> pressing ALT-U in some controls activates the '&Update' button in a
>> completely different control. This is a REALLY BAD THING. To add tothe >> confusion, the Access Keys work correctly and consistently in some
>controls
>> and consistently fail (while activating the access key in other

completely
>> unrelated user controls).
>>
>> We have have reverted to the Net 2002 Version of the app which works
>> correctly. i.e. Pressing ALT-U within in a control activates that
>> control's '&Update' button. The combobox issue also works correctly
>with
>> the Net 2002 version.
>>
>> Barry
>> Oregon
>>
>>
>> "Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
>> news:hw******** ******@cpmsftng xa07.phx.gbl...
>> > Hi Barry,
>> >
>> > Based on my test, when you assign a "value" toComboBox.Selec tedValue, >if
>> > this value is in the list of the combobox, SelectedIndex is set toits >> > index. Otherwise, the SelectedIndex property keeps unchanged. As for

the
>> > 'Access Keys', do you have duplicate Access Keys defined in the
>> > application?
>> >
>> > Regards,
>> >
>> > Felix Wu
>> > =============
>> > This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> >
>> >
>> > --------------------
>> > >Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
>> > >From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
>> > >Subject: recompiling VS NET WinForms app with VS NET 2003 causing
>serious
>> > problems.
>> > >Date: Wed, 4 Feb 2004 11:30:58 -0800
>> > >Lines: 40
>> > >X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
>> > >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
>> > >Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
>> > >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
>> > >NNTP-Posting-Host: 159.121.113.234
>> > >Path:
>> >
>>


cpmsftngxa07. phx.gbl!cpmsftn gxa10.phx.gbl!T K2MSFTNGXA07.ph x.gbl!TK2MSFTNG X A 0
>> >

6.phx.gbl!TK2M SFTNGXA05.phx.g bl!TK2MSFTNGP08 .phx.gbl!TK2MSF TNGP09.phx.gbl >> > >Xref: cpmsftngxa07.ph x.gbl
>> microsoft.publi c.dotnet.langua ges.csharp:2182 15
>> > >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
>> > >
>> > >We just recently moved one of our major c# apps from VS Net 2002 toVS >> Net
>> > >2003. At first things were looking ok, now problems are startingto >> > >appear.
>> > >
>> > >So far ...
>> > >
>> > >(1) ComboBox.Select edValue = db_value;
>> > >
>> > >If the db_value was not included in the ComboBox value list the
>> > >ComboBox.Selec tedIndex used to return -1, Now the very same code is
>> > >returning 0, we are checking for -1. We use this trait quite a bit >and
>> I
>> > >want to know what's going on before weeding it out of 100,000 linesof >C#
>> > >across 24 separate user controls.
>> > >
>> > >(2) command button 'Access Keys' or Alt-character ...
>> > >
>> > >specified by inserting & into the button text value have begunacting >> > >abnormal. We have a main form that contains 24 user controls each

with
>> an
>> > >'&Add', '&Update' and '&Delete' button. When compiled in VS Net2002 >> all
>> > >of these keys worked fine. After compiling with VS Net 2003 the

ALT-A,
>> > >ALT-U & ALT-D buttons work on about half of the controls and refuseto >> work
>> > >on the rest. No clear indication as to why. The data entry staff is >> > >standing outside my cube with Pitch Forks and Axes !!!
>> > >
>> > >What's going on here ???? (Besides not looking carefully enough

before
>> we
>> > >leaped.)
>> > >
>> > >
>> > >Is there a FAQ or message thread for problems with VS Net 2002 to VS >Net
>> > >2003 conversions somewhere?
>> > >
>> > >
>> > >Near death experiences like this are extremely unplesant.
>> > >
>> > >Thanks in advance.
>> > >
>> > >Barry
>> > >Oregon
>> > >
>> > >
>> > >
>> >
>>
>>
>
>
>



Nov 15 '05 #9
Felix,

1st: The override of ProcessDialogCh ar( ) method is working great. It
forces our User Controls to handle the ALT- keys 'locally' just as we
needed. Yahooo.

2nd: Thanks for the 'heads up' on the combobox. Its very much appreciated.
We've avoided this particular issue because most of our comboboxes are
loaded from lookup tables that include a blank (null) display value that we
place at SelectedIndex 0. :-) So the method we're now using resets the
Combobox index to 0, then loads the db value into the
ComboBox.Select edValue. The database values will never be blank or null in
these cases so if the Selected Index is < 1 we know that there was no match.
Seems to be working so far. :-)

Thank you very much for your help with this issue.

Best wishes & Happy Computing!

Barry
Oregon

"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:VE******** ******@cpmsftng xa07.phx.gbl...
Welcome, Barry.

However, I am afraid that simply checking SelectedIndex < 1 is not enough.
Since SelectedIndex zero-based, what if the dbValueString happens to be the same as the first value in the list?

One workaround is to check if the new value equals the first value in the
list when SelectedIndex is 0. For example:

DataRowView drv=(DataRowVie w)comboBox1.Ite ms[0];

...
comboBox1.Selec tedValue=newVal ;

if (comboBox1.Sele ctedIndex==-1 || (comboBox1.Sele ctedIndex==0 &&
(drv["colName"].ToString()!=ne wVal.ToString() )))
MessageBox.Show ("It's Invalid: " + newVal.ToString ());
else
MessageBox.Show ("It's Valid: " + newVal.ToString ());

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
References: <#Q************ **@TK2MSFTNGP09 .phx.gbl> <hw************ **@cpmsftngxa07 .phx.gbl>
<OW************ **@TK2MSFTNGP09 .phx.gbl>
<#j************ **@TK2MSFTNGP09 .phx.gbl>
<KK************ **@cpmsftngxa07 .phx.gbl>
Subject: Re: recompiling VS NET WinForms app with VS NET 2003 causing

serious problems.
Date: Mon, 9 Feb 2004 08:06:17 -0800
Lines: 267
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
Message-ID: <OT************ **@TK2MSFTNGP10 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: 159.121.113.234
Path:

cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8 phx.gbl!TK2MSFT NGP10.phx.gbl
Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2192 91
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp

Felix,

THANKS for the info! Its very much appreciated. I've think we've

corrected
the Combobox anomolie by checking for < 1 rather than == -1.

I'm working on integrating the ProcessDialogCh ar override.

I'll post back to the group with the results.

Again many THANKS !!

Barry
Oregon
"Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
news:KK******* *******@cpmsftn gxa07.phx.gbl.. .
Hi Barry,

I repro-ed the accesss key issue you mentioned. To resolve this problem, you can override ProcessDialogCh ar in all your UserControls:

public class UserControl1 : System.Windows. Forms.UserContr ol
{
...
protected override bool ProcessDialogCh ar(char charCode)
{
if (charCode != ' ' && ProcessMnemonic (charCode)) return true;
return base.ProcessDia logChar(charCod e);
}
...
}
However, I am not able to repro SelectedIndex issue. It shows the same
behavior in both .NET Framework 1.0 and 1.1.

Actually, when you set a value to the SelectedValue property, combobox
searches its list and returns the index if the value is found, otherwise, returns -1. This return value is set to the SelectedIndex property of the control. Then, combobox needs to update the CurrencyManager .Position
property of the underlying datasource based on the SelectedIndex. However, the Position will be adjusted to 0 if the SelectedIndex is less than 0.
After this, CurrencyManager updates the underlying datasource if it finds that the current Position value (is adjusted "0" is this case) is

different
from the previous Position value. During this process, CurrencyManager
will udpate the SelectedIndex to the current CurrencyManager .Position
value, that is, 0.

In a nutshell, if the current SelectedIndex is "0", SelectedIndex will
return -1 when you set an invaid value (the value that is not included in the ComboBox value list ) to the SelectedValue property. If the current
SelectedIndex is not "0", it will return 0.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no

rights.


--------------------
>Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
>From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
>References: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
<hw************ **@cpmsftngxa07 .phx.gbl>
<OW************ **@TK2MSFTNGP09 .phx.gbl>
>Subject: Re: recompiling VS NET WinForms app with VS NET 2003 causing
serious problems.
>Date: Thu, 5 Feb 2004 16:59:57 -0800
>Lines: 153
>X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
>Message-ID: <#j************ **@TK2MSFTNGP09 .phx.gbl>
>Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
>NNTP-Posting-Host: 159.121.113.234
>Path:

cpmsftngxa07.p hx.gbl!cpmsftng xa10.phx.gbl!TK 2MSFTNGXA05.phx .gbl!TK2MSFTNGP 0
8 phx.gbl!TK2MSFT NGP09.phx.gbl
>Xref: cpmsftngxa07.ph x.gbl

microsoft.publ ic.dotnet.langu ages.csharp:218 632
>X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
>
>Felix,
>
>This situation is so critical that I've started a case with MS Tech
support.
>I've got a partial solution so far the problem has not been completely
>resolved. I'll post to this string with the resolution when the problemis
>resolved. Thanks.
>
>Barry
>Oregon
>
>
>"BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us> wrote in message
>news:OW******* *******@TK2MSFT NGP09.phx.gbl.. .
>> Felix,
>>
>> Thanks for the quick response ... our attempt to move to VS Net 2003 is >> definitely stopped until we can correct these problems.
>>
>> 1st - Please understand that this data entry application has been

WORKING
>> PROBLEM FREE FOR OVER A YEAR when compiled with VS Net 2002. These
>problems
>> appeared only when we used VS Net 2003 to recompile the application.
This
>> is a very large and complex data entry application supporting the State of
>> Oregon's Water Right Tracking system.
>>
>> The application has a Main Form that contains 24 user controls.
EACH USER
>> CONTROL HAS an
>> '&Add', '&Update' and '&Delete' button. So the answer to your

question
>is
>> 'yes', the Main Form contains 24 '&Update' buttons, with each User
>Control
>> containing a single '&Update' button. However, previously in Net 2002 >> Access Keys behaved as if each User Control was an application unto
>itself.
>> Net 2003 seems to have somehow broken that functionality.
>>
>> Until we recompiled the app using VS Net 2003, pressing ALT-U withinany
>> control activated the control's '&Update' button. Now we have
found >that
>> pressing ALT-U in some controls activates the '&Update' button in a
>> completely different control. This is a REALLY BAD THING. To add to
the
>> confusion, the Access Keys work correctly and consistently in some
>controls
>> and consistently fail (while activating the access key in other
completely
>> unrelated user controls).
>>
>> We have have reverted to the Net 2002 Version of the app which works
>> correctly. i.e. Pressing ALT-U within in a control activates that
>> control's '&Update' button. The combobox issue also works
correctly >with
>> the Net 2002 version.
>>
>> Barry
>> Oregon
>>
>>
>> "Felix Wu [MSFT]" <fe*****@online .microsoft.com> wrote in message
>> news:hw******** ******@cpmsftng xa07.phx.gbl...
>> > Hi Barry,
>> >
>> > Based on my test, when you assign a "value" to

ComboBox.Selec tedValue,
>if
>> > this value is in the list of the combobox, SelectedIndex is set to

its
>> > index. Otherwise, the SelectedIndex property keeps unchanged. As for the
>> > 'Access Keys', do you have duplicate Access Keys defined in the
>> > application?
>> >
>> > Regards,
>> >
>> > Felix Wu
>> > =============
>> > This posting is provided "AS IS" with no warranties, and confers no >> rights.
>> >
>> >
>> > --------------------
>> > >Reply-To: "BBFrost" <ba***********@ wrd.state.or.us >
>> > >From: "BBFrost" <barry.b.frost@ remove_this.wrd .state.or.us>
>> > >Subject: recompiling VS NET WinForms app with VS NET 2003 causing
>serious
>> > problems.
>> > >Date: Wed, 4 Feb 2004 11:30:58 -0800
>> > >Lines: 40
>> > >X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
>> > >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
>> > >Message-ID: <#Q************ **@TK2MSFTNGP09 .phx.gbl>
>> > >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
>> > >NNTP-Posting-Host: 159.121.113.234
>> > >Path:
>> >
>>

cpmsftngxa07. phx.gbl!cpmsftn gxa10.phx.gbl!T K2MSFTNGXA07.ph x.gbl!TK2MSFTNG X

A 0
>> >

6.phx.gbl!TK2M SFTNGXA05.phx.g bl!TK2MSFTNGP08 .phx.gbl!TK2MSF TNGP09.phx.gbl
>> > >Xref: cpmsftngxa07.ph x.gbl
>> microsoft.publi c.dotnet.langua ges.csharp:2182 15
>> > >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
>> > >
>> > >We just recently moved one of our major c# apps from VS Net 2002 toVS
>> Net
>> > >2003. At first things were looking ok, now problems are
starting
to
>> > >appear.
>> > >
>> > >So far ...
>> > >
>> > >(1) ComboBox.Select edValue = db_value;
>> > >
>> > >If the db_value was not included in the ComboBox value list the
>> > >ComboBox.Selec tedIndex used to return -1, Now the very same code
is >> > >returning 0, we are checking for -1. We use this trait quite a

bit >and
>> I
>> > >want to know what's going on before weeding it out of 100,000 linesof
>C#
>> > >across 24 separate user controls.
>> > >
>> > >(2) command button 'Access Keys' or Alt-character ...
>> > >
>> > >specified by inserting & into the button text value have begun

acting
>> > >abnormal. We have a main form that contains 24 user controls
each with
>> an
>> > >'&Add', '&Update' and '&Delete' button. When compiled in VS Net

2002
>> all
>> > >of these keys worked fine. After compiling with VS Net 2003 the
ALT-A,
>> > >ALT-U & ALT-D buttons work on about half of the controls and
refuseto
>> work
>> > >on the rest. No clear indication as to why. The data entry staff

is >> > >standing outside my cube with Pitch Forks and Axes !!!
>> > >
>> > >What's going on here ???? (Besides not looking carefully enough
before
>> we
>> > >leaped.)
>> > >
>> > >
>> > >Is there a FAQ or message thread for problems with VS Net 2002 to VS >Net
>> > >2003 conversions somewhere?
>> > >
>> > >
>> > >Near death experiences like this are extremely unplesant.
>> > >
>> > >Thanks in advance.
>> > >
>> > >Barry
>> > >Oregon
>> > >
>> > >
>> > >
>> >
>>
>>
>
>
>


Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2204
by: Jeff Levinson [mcsd] | last post by:
I guess I would have to know what you mean by "not being able to edit the forms". Does this mean you get an error in the designer when you try to display an inherited form? Does this mean the controls are visible, but you can't move them around? What exactly does it mean? There are a variety of methods for editing visuallly inherited forms and I've never had a problem with it in any version of VS.
0
1390
by: Anil0920 | last post by:
I have a very serious problem which really needs to be solved. We had a huge number of projects in 2002 that we recently converted to VS.NET 2003. The conversion was smooth and all is working well. How-ever when we make any change to a form and save the form using VS.NET 2003, it reorganizes all form elements and the width / height of text boxes get changed, making it look very different from the way it looked before. The problem...
0
1296
by: Ryan Liu | last post by:
All, Now I have meet a strange problems. When all the files have been compiled and when linking, make always recompiles some files. I don't know why. Would you mind giving some suggestion? The following is the recompiling error? *************************************************** collect: recompiling Time-data.cpp
13
1223
by: rawCoder | last post by:
Dear All, Just wanted to inquire whether VS.NET 2005 Beta is more stable than the VS.NET 2003 (using common features only as in case of a port) ? Also when is right time (earliest) to port a product made in VS.NET 2003 to the newer version and whether its redistributable is available or not ? Thank You in advance rawCoder
5
1318
by: Colonel Kernel | last post by:
I've found what seems to be a very serious (although obscure) bug in VC++.NET 2003 when using Loki's class hierarchy-generation facilities. The compiler seems to generate an invalid v-table for my class, which causes virtual method calls to dispatch incorrectly, causing run-time errors and crashes. The problem seems to occur because the compiler doesn't catch the case where I give a template method the same name as a virtual method defined...
11
2210
by: Steve Smith | last post by:
I have written a winforms application that launches approximately 150 threads with Thread.ThreadStart() Each thread uses CDO 1.21 to logon to a different Exchange mailbox and send/receive a number of mail messages, reporting back to the UI thread through the use of a Queue object. When all messages that are expected have been received, each thread sends a final update to the UI and the method should exit, which should terminate the...
0
934
by: Dinsdale | last post by:
I have a Winforms app written in .Net 1.1 (C#) that runs great so long as Outlook isn't open. As soon as I have Outlook running, the entire computer becomes sluggish and Outlook simply stops working for the most part. If, for instance, I have both my app and Outlook running and I try to open an email, outlook becomes unresponsive until I close my app again. Can anyone suggest a good way to track down what is causing this behaviour....
0
1702
by: elbetzio | last post by:
Evening, I've got a highly irritating bug with the reportviewer control that appears to be a show-stopper for one of our bigger applications we're writing. When I try and print more than 1 page of any given report, I the application hangs, a Window comes up saying "printing page 2 of y", and after a period of waiting for the mysterious page to print, VS2005 throws the following error:
0
8829
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8726
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7997
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5972
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4746
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3186
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.