Click here to Skip to main content
15,898,991 members
Home / Discussions / C#
   

C#

 
GeneralRe: verify SQLServer access Pin
Luis Alonso Ramos18-Jul-07 5:29
Luis Alonso Ramos18-Jul-07 5:29 
GeneralRe: verify SQLServer access Pin
redivider18-Jul-07 6:39
redivider18-Jul-07 6:39 
QuestionSuggest me about MRCopy Pin
il_masacratore17-Jul-07 11:52
il_masacratore17-Jul-07 11:52 
QuestionAny one have Ideas for IT graduation Project Pin
michaelqog17-Jul-07 11:01
michaelqog17-Jul-07 11:01 
AnswerRe: Any one have Ideas for IT graduation Project Pin
dino209417-Jul-07 11:13
dino209417-Jul-07 11:13 
GeneralRe: Any one have Ideas for IT graduation Project Pin
Malcolm Smart17-Jul-07 11:18
Malcolm Smart17-Jul-07 11:18 
GeneralRe: Any one have Ideas for IT graduation Project Pin
Colin Angus Mackay17-Jul-07 11:29
Colin Angus Mackay17-Jul-07 11:29 
GeneralRe: Any one have Ideas for IT graduation Project Pin
Rao Rafique17-Jul-07 22:51
Rao Rafique17-Jul-07 22:51 
AnswerRe: Any one have Ideas for IT graduation Project Pin
Paul Conrad17-Jul-07 11:57
professionalPaul Conrad17-Jul-07 11:57 
QuestionProblem retrieving dataobjects stored on clipboard Pin
Sepharo17-Jul-07 10:59
Sepharo17-Jul-07 10:59 
QuestionLooping through Controls on a tab page Pin
greenb17-Jul-07 10:33
greenb17-Jul-07 10:33 
AnswerRe: Looping through Controls on a tab page Pin
Tarakeshwar Reddy17-Jul-07 10:44
professionalTarakeshwar Reddy17-Jul-07 10:44 
GeneralRe: Looping through Controls on a tab page Pin
BoneSoft17-Jul-07 10:49
BoneSoft17-Jul-07 10:49 
GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult17-Jul-07 10:51
mvePIEBALDconsult17-Jul-07 10:51 
GeneralRe: Looping through Controls on a tab page Pin
Tarakeshwar Reddy17-Jul-07 10:58
professionalTarakeshwar Reddy17-Jul-07 10:58 
GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult17-Jul-07 11:18
mvePIEBALDconsult17-Jul-07 11:18 
GeneralRe: Looping through Controls on a tab page Pin
BoneSoft17-Jul-07 11:32
BoneSoft17-Jul-07 11:32 
GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult17-Jul-07 11:43
mvePIEBALDconsult17-Jul-07 11:43 
GeneralRe: Looping through Controls on a tab page Pin
BoneSoft17-Jul-07 12:08
BoneSoft17-Jul-07 12:08 
GeneralRe: Looping through Controls on a tab page [modified] Pin
PIEBALDconsult17-Jul-07 17:17
mvePIEBALDconsult17-Jul-07 17:17 
GeneralRe: Looping through Controls on a tab page Pin
Martin#17-Jul-07 20:03
Martin#17-Jul-07 20:03 
GeneralRe: Looping through Controls on a tab page Pin
Mike Dimmick17-Jul-07 11:42
Mike Dimmick17-Jul-07 11:42 
PIEBALDconsult wrote:
I still haven't found a worthwhile use for as.


Generally if I need to know whether a variable is of a particular type, I need to use some method of that type that isn't in the base type. So for example, if I wanted to select all the text in the textboxes on a form, where the form has other types of control as well, I'd write:
TextBox tb;
 
foreach( Control ctl in Controls )
{
   if ( null != ( tb = ctl as TextBox ) )
   {
      tb.SelectAll();
   }
}
Using as saves performing the type check twice: once to get the result of is, and again to perform the cast.



Stability. What an interesting concept. -- Chris Maunder

GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult17-Jul-07 11:49
mvePIEBALDconsult17-Jul-07 11:49 
JokeRe: Looping through Controls on a tab page Pin
BoneSoft17-Jul-07 12:10
BoneSoft17-Jul-07 12:10 
GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult17-Jul-07 14:04
mvePIEBALDconsult17-Jul-07 14:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.