Problem mit Miniprogramm...

Dir fehlt das object sender in der Parameterliste.
Code:
public void button4_MouseMove(object sender, MouseEventArgs e)
{
	int a = 0;
	int b = 0;

	a = button4.Location.X;
	b = button4.Location.Y;

	button4.Location = button3.Location;
	if (button4.Location == button3.Location)
	{
		button3.Location = new System.Drawing.Point(a,b);
	}
}
 
Hey...hab jetzt noch ne echt doofe frage...

habe die ganzen Berechnungen und Umwandlungen mit "int" gemacht und da hab ich jetzt aber das Problem mit den Kommazahlen...das funktioniert nicht..ich denke, dass muss ich mit "float" machen, schaffs aber nicht...

hier der Code so wie´s funktioniert wenn es keine Kommazahlen geben muss...

Code:
private void btnl1_Click(object sender, System.EventArgs e)
		{
			int v,u,g,h,j,k;

			g=Convert.ToInt32(lbl1.Text);
			h=Convert.ToInt32(lbl2.Text);
			j=Convert.ToInt32(lbl3.Text);			
			k=Convert.ToInt32(lblm1.Text);
			v=Convert.ToInt32(txt1.Text);
	
			u=g+h+j+k;						

			if(v==u)
			{
				lbla1.Text="Richtig";		
			}								
			else
			{
				lbla1.Text="Falsch";
			}
			
		}
 
Das sollte alles sein, was du wissen musst

Code:
Datentyp  Wertebereich  Speicher  
Ganzzahlen  
byte  0 bis 255  8 Bit  
sbyte  -128 bis 127  8 Bit  
short  -32.768 bis 32.767  16 Bit  
ushort  0 bis 65.535  16 Bit  
int  -2.147.483.648 bis 2.147.483.647  32 Bit  
uint  0 bis 4.294.967.295  32 Bit  
long  -9.223.372.036.854.775.808 bis 9.223.372.036.854.775.807  64 Bit  
ulong  0 bis 18.446.744.073.709.551.615  64 Bit  
Gleitkommazahlen  
float  1.5 * 10-45 bis 3.4 * 1038  32 Bit  
double  5.0 * 10-324 bis 1.7 * 10308  64 Bit  
decimal  1.0 * 10-28 bis 7.9 * 1028  128 Bit  
Zeichen  
char  Einzelne Zeichen  16 Bit  
string  Zeichenketten  -  
Sonstiges  
bool  true und false  1 Bit



Code:
Datentyp  Klasse  
bool  Boolean  
byte  Byte  
char  Char  
decimal  Decimal  
double  Double  
float  Single  
int  Int32  
long  Int64  
short  Int16  
uint  UInt32  
ushort  UInt16  
ulong  UInt64

Mfg
ziop
 
diese Tabelle hatte ich schon, aber das hilft mir nicht wirklich weiter...

muss ich das bei den Eingabefeldern selber einstellen oder wie geht das?
 
Hmm, versuchs mal so:
Code:
private void btnl1_Click(object sender, System.EventArgs e)
		{
			string g = lbl1.Text;
                                                double valG =0;

                                                valG = Int64.parse(g);
                                                ... etc					

			if(v==u)
			{
				lbla1.Text="Richtig";		
			}								
			else
			{
				lbla1.Text="Falsch";
			}
			
		}
 

Neue Beiträge

Zurück