Conditional Assignment
- From: "Fir5tSight" <fir5tsight@xxxxxxxxx>
- Date: 17 Jan 2007 12:55:27 -0800
Hi All,
I have the following code in C#:
lSelectedFilter = 1;
this.tabFilters.SelectedIndex = (lSelectedFilter == 0 ? 0
: lSelectedFilter - 1);
After executing the above statements, this.tabFilters.SelectedIndex is
changed to -1. Why? I expected it to be 0. Anyone can explain it to me?
Thanks!
-Emily
.
- Follow-Ups:
- Re: Conditional Assignment
- From: Jon Skeet [C# MVP]
- Re: Conditional Assignment
- Prev by Date: Cannot Send Messages To Newsgroups
- Next by Date: Wrapped text hittest: Good way to do it?
- Previous by thread: Cannot Send Messages To Newsgroups
- Next by thread: Re: Conditional Assignment
- Index(es):