Admin Admin
Mesaj Sayısı : 72 Kayıt tarihi : 02/12/08
| Konu: C# bazı operatörlerin değerleri Perş. Ara. 04, 2008 3:52 pm | |
| - Kod:
-
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;
namespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) {
}
private void litsbox1_SelectedIndexChanged(object sender, System.EventArgs e) { switch (type.Text) { case "int" : showIntValue(); break; case "long" : showLongValue(); break; case "float" : showFloatValue(); break; case "double" : showDoubleValue(); break; case "decimal" : showDecimalValue(); break; case "string" : showStringValue(); break; case "char" : showCharValue(); break; case "bool" : showBoolValue(); break; } }
private void showIntValue() { value.Text = "to do"; }
private void showLongValue() { long deger; deger = 42L; value.Text = "42L"; }
private void showFloatValue() { float deger; deger = 0.42F; value.Text = "0.42F"; }
private void showDoubleValue() { value.Text = "to do"; }
private void showDecimalValue() { decimal deger; deger = 0.42M; value.Text = "0.42M"; }
private void showStringValue() { string deger; deger = "42"; value.Text = "\"42\""; }
private void showCharValue() { char deger; deger = '4'; value.Text = "'4'"; }
private void showBoolValue() { value.Text = "to do"; }
private void quit_Click(object sender, System.EventArgs e) { Application.Exit(); } } | |
|