23.08.2011, 21:23
Tach Leute,
also, ich programmiere im Moment etwas in C#, dazu habe ich eine Funktion erstellt welche prüft ob eine Textbox einen Inhalt hat, hier der code:
also, ich programmiere im Moment etwas in C#, dazu habe ich eine Funktion erstellt welche prüft ob eine Textbox einen Inhalt hat, hier der code:
Code:
//prüfe ob eine box benutzt ist
static int checkbox(TextBox a){
bool inhalt = true;
if(a.Text == ""){
inhalt = false;
}
return inhalt;
}
Doch nun sagt der Compiller mir: Eine implizite Konvertierung vom Typ "bool" in "int" ist nicht möglich.
Was mache ich falsch???
Danke im vorraus
mfg
davdda