also schon mal danke
aber bei uns klappt das irgendwie nicht....ich glaube das liegt daran, dass wir visual j# benutzen....
bei uns sieht der Quelltext folgendermaßen aus: (also der schon vom Programm her, vorgegebene Quelltext), das einzige, was wir hinzugefügt haben ist das mit dem double...
package ggt;
import System.Collections.Generic.*;
import System.Data.*;
import System.Drawing.*;
import System.ComponentModel.*;
import System.Windows.Forms.*;
/**
* Summary description for Form1.
*/
public class Form1 extends System.Windows.Forms.Form
{
private TextBox textBox1;
private TextBox textBox2;
private TextBox textBox3;
private Button button1;
private TextBox textBox4;
private Button button2;
private TextBox textBox5;
private TextBox textBox6;
private TextBox textBox7;
/**
* Required designer variable.
*/
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
#region Windows Form Designer generated code
/**
* Clean up any resources being used.
*/
protected void Dispose(boolean disposing)
{
if (disposing)
{
if (components != null)
{
components.Dispose();
}
}
super.Dispose(disposing);
}
/**
* Required method for Designer support - do not modify
* the contents of this method with the code editor.
*/
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.textBox4 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.textBox5 = new System.Windows.Forms.TextBox();
this.textBox6 = new System.Windows.Forms.TextBox();
this.textBox7 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.set_Location(new System.Drawing.Point(12, 29));
this.textBox1.set_Name("textBox1");
this.textBox1.set_Size(new System.Drawing.Size(100, 20));
this.textBox1.set_TabIndex(0);
this.textBox1.add_TextChanged(new System.EventHandler(this.textBox1_TextChanged));
//
// textBox2
//
this.textBox2.set_Location(new System.Drawing.Point(12, 79));
this.textBox2.set_Name("textBox2");
this.textBox2.set_Size(new System.Drawing.Size(100, 20));
this.textBox2.set_TabIndex(1);
this.textBox2.add_TextChanged(new System.EventHandler(this.textBox2_TextChanged));
//
// textBox3
//
this.textBox3.set_Location(new System.Drawing.Point(12, 118));
this.textBox3.set_Name("textBox3");
this.textBox3.set_Size(new System.Drawing.Size(100, 20));
this.textBox3.set_TabIndex(2);
this.textBox3.add_TextChanged(new System.EventHandler(this.textBox3_TextChanged));
//
// button1
//
this.button1.set_Location(new System.Drawing.Point(12, 164));
this.button1.set_Name("button1");
this.button1.set_Size(new System.Drawing.Size(75, 23));
this.button1.set_TabIndex(3);
this.button1.set_Text("button1");
this.button1.set_UseVisualStyleBackColor(true);
this.button1.add_Click(new System.EventHandler(this.button1_Click));
//
// textBox4
//
this.textBox4.set_Location(new System.Drawing.Point(180, 118));
this.textBox4.set_Name("textBox4");
this.textBox4.set_Size(new System.Drawing.Size(100, 20));
this.textBox4.set_TabIndex(4);
this.textBox4.add_TextChanged(new System.EventHandler(this.textBox4_TextChanged));
//
// button2
//
this.button2.set_Location(new System.Drawing.Point(216, 180));
this.button2.set_Name("button2");
this.button2.set_Size(new System.Drawing.Size(53, 36));
this.button2.set_TabIndex(5);
this.button2.set_Text("button2");
this.button2.set_UseVisualStyleBackColor(true);
this.button2.add_Click(new System.EventHandler(this.button2_Click));
//
// textBox5
//
this.textBox5.set_Location(new System.Drawing.Point(180, 79));
this.textBox5.set_Name("textBox5");
this.textBox5.set_Size(new System.Drawing.Size(100, 20));
this.textBox5.set_TabIndex(6);
//
// textBox6
//
this.textBox6.set_Location(new System.Drawing.Point(180, 29));
this.textBox6.set_Name("textBox6");
this.textBox6.set_Size(new System.Drawing.Size(100, 20));
this.textBox6.set_TabIndex(7);
//
// textBox7
//
this.textBox7.set_Location(new System.Drawing.Point(180, 154));
this.textBox7.set_Name("textBox7");
this.textBox7.set_Size(new System.Drawing.Size(100, 20));
this.textBox7.set_TabIndex(8);
//
// Form1
//
this.set_AutoScaleDimensions(new System.Drawing.SizeF(6F, 13F));
this.set_AutoScaleMode(System.Windows.Forms.AutoScaleMode.Font);
this.set_ClientSize(new System.Drawing.Size(292, 266));
this.get_Controls().Add(this.textBox7);
this.get_Controls().Add(this.textBox6);
this.get_Controls().Add(this.textBox5);
this.get_Controls().Add(this.button2);
this.get_Controls().Add(this.textBox4);
this.get_Controls().Add(this.button1);
this.get_Controls().Add(this.textBox3);
this.get_Controls().Add(this.textBox2);
this.get_Controls().Add(this.textBox1);
this.set_Name("Form1");
this.set_Text("Form1");
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private void textBox1_TextChanged(Object sender, System.EventArgs e)
{
}
private void textBox2_TextChanged(Object sender, System.EventArgs e)
{
}
private void textBox3_TextChanged(Object sender, System.EventArgs e)
{
}
private void button1_Click(Object sender, System.EventArgs e)
{
double summe;
int i = (int) summe ;
summe = (Double.parseDouble(textBox1.get_Text()) / Double.parseDouble(textBox2.get_Text()));
textBox3.set_Text(String.Format("{0:f}", (System.Double)summe));
Math.floor((summe));
double summe1;
summe1 = summe * Double.parseDouble(textBox2.get_Text()); ; textBox3.set_Text(String.Format("{0:f}", (System.Double)summe));
}
private void textBox4_TextChanged (Object sender, System.EventArgs e)
{
}
private void button2_Click(Object sender, System.EventArgs e)
{
}
}
und wenn ich da jetzt irgendwo, private oder public hinzufüge, bekomme ich ne Fehlermeldung: "Unexpected private/public", "Syntax error" ....
Wir haben schon sooo vieles ausprobiert und nichts klapppttt ! Vor allem int erkennt dieses Programm komischerweise nicht bzw. erscheinen immer wieder Fehlermeldungen.