Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 19th, 2010 | Syntax: C# | Size: 2.72 KB | Hits: 65 | Expires: Never
Copy text to clipboard
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Hello_World
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         public static int msgbox(string title, string message)
  20.         {
  21.             //title = "Titel";
  22.             //message = "Test-Message";
  23.             MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
  24.             return 0;
  25.         }
  26.  
  27.         private void Form1_Load(object sender, EventArgs e)
  28.         {
  29.             //this.Opacity = 10;            
  30.             Hello_World.Form1.ActiveForm.Opacity = 80;
  31.             msgbox("Ich bin der Titel!", "Ich bin eine Test-Nachricht!");
  32.             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  33.             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
  34.            
  35.  
  36.         }
  37.  
  38.         private void button1_Click(object sender, EventArgs e)
  39.         {
  40.             Close();
  41.             this.Opacity = 10;
  42.         }
  43.  
  44.         private void button2_Click(object sender, EventArgs e)
  45.         {
  46.             if (prg.Value < 100)
  47.             {
  48.                 prg.Value++;
  49.             }
  50.            
  51.         }
  52.  
  53.         private void button3_Click(object sender, EventArgs e)
  54.         {
  55.             if (prg.Value > 0)
  56.             {
  57.                 prg.Value--;
  58.             }            
  59.         }
  60.  
  61.         private void check_Tick(object sender, EventArgs e)
  62.         {
  63.  
  64.             if (autoup.Checked == true)
  65.             {
  66.                 groupBox1.Enabled = false;
  67.                 progress.Enabled = true;
  68.             }
  69.             else
  70.             {
  71.                 groupBox1.Enabled = true;
  72.                 progress.Enabled = false;
  73.             }
  74.  
  75.             if (textBox1.Text.Length < 1)
  76.             {
  77.                 textBox1.Text = "1";
  78.             }
  79.         }
  80.  
  81.         private void progress_Tick(object sender, EventArgs e)
  82.         {
  83.             if (Char.IsDigit(textBox1.Text, 0) == true)
  84.             {
  85.                 if (prg.Value + Convert.ToInt32(textBox1.Text) < 100)
  86.                 {
  87.                     prg.Value++;
  88.                     prg.Value = prg.Value + Convert.ToInt32(textBox1.Text);
  89.                 }
  90.                 else
  91.                 {
  92.                     prg.Value = 0;
  93.                 }
  94.             }
  95.             else
  96.             {
  97.                 autoup.Checked = false;
  98.                 msgbox("Fehler!", "Bitte nur Zahlen!");
  99.                 textBox1.Text = "1";                
  100.             }
  101.  
  102.         }
  103.     }
  104. }