Untitled
By: a guest | Mar 19th, 2010 | Syntax:
C# | Size: 2.72 KB | Hits: 65 | Expires: Never
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 Hello_World
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static int msgbox(string title, string message)
{
//title = "Titel";
//message = "Test-Message";
MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
return 0;
}
private void Form1_Load(object sender, EventArgs e)
{
//this.Opacity = 10;
Hello_World.Form1.ActiveForm.Opacity = 80;
msgbox("Ich bin der Titel!", "Ich bin eine Test-Nachricht!");
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
}
private void button1_Click(object sender, EventArgs e)
{
Close();
this.Opacity = 10;
}
private void button2_Click(object sender, EventArgs e)
{
if (prg.Value < 100)
{
prg.Value++;
}
}
private void button3_Click(object sender, EventArgs e)
{
if (prg.Value > 0)
{
prg.Value--;
}
}
private void check_Tick(object sender, EventArgs e)
{
if (autoup.Checked == true)
{
groupBox1.Enabled = false;
progress.Enabled = true;
}
else
{
groupBox1.Enabled = true;
progress.Enabled = false;
}
if (textBox1.Text.Length < 1)
{
textBox1.Text = "1";
}
}
private void progress_Tick(object sender, EventArgs e)
{
if (Char.IsDigit(textBox1.Text, 0) == true)
{
if (prg.Value + Convert.ToInt32(textBox1.Text) < 100)
{
prg.Value++;
prg.Value = prg.Value + Convert.ToInt32(textBox1.Text);
}
else
{
prg.Value = 0;
}
}
else
{
autoup.Checked = false;
msgbox("Fehler!", "Bitte nur Zahlen!");
textBox1.Text = "1";
}
}
}
}