Check IT


  Hinweis:

Die Bilddateien müssen als Resourcen über das Pull-Down-Menü 
Project>Properties>Resources>Add Resource
in das Projekt eingefügt werden.

Download:

Zip-Datei (30KB)


 

Sourcecode:



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace check_it
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btn_end_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void test()
        {
            if (pic_1.Image != null)
            {
                pic_1.Image = null;
            }

            if (rdb_vielleicht.Checked)
            {
                pic_1.Image = Properties.Resources.richtig;
            }
            else
            {
                pic_1.Image = Properties.Resources.falsch;
            }
        }

        private void rdb_vielleicht_CheckedChanged(object sender, EventArgs e)
        {
            test();
        }
        private void rdb_richtig_CheckedChanged(object sender, EventArgs e)
        {
            test();
        }

        private void rdb_falsch_CheckedChanged(object sender, EventArgs e)
        {
            test();
        }
    }
}




#region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btn_end = new System.Windows.Forms.Button();
            this.lbl_Frage = new System.Windows.Forms.Label();
            this.rdb_richtig = new System.Windows.Forms.RadioButton();
            this.rdb_falsch = new System.Windows.Forms.RadioButton();
            this.rdb_vielleicht = new System.Windows.Forms.RadioButton();
            this.pic_1 = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.pic_1)).BeginInit();
            this.SuspendLayout();
            //
            // btn_end
            //
            this.btn_end.Location = new System.Drawing.Point(48, 202);
            this.btn_end.Name = "btn_end";
            this.btn_end.Size = new System.Drawing.Size(209, 54);
            this.btn_end.TabIndex = 4;
            this.btn_end.Text = "Beenden";
            this.btn_end.UseVisualStyleBackColor = true;
            this.btn_end.Click += new System.EventHandler(this.btn_end_Click);
            //
            // lbl_Frage
            //
            this.lbl_Frage.AutoSize = true;
            this.lbl_Frage.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lbl_Frage.Location = new System.Drawing.Point(80, 9);
            this.lbl_Frage.Name = "lbl_Frage";
            this.lbl_Frage.Size = new System.Drawing.Size(144, 31);
            this.lbl_Frage.TabIndex = 0;
            this.lbl_Frage.Text = "1 + 1 = 10";
            //
            // rdb_richtig
            //
            this.rdb_richtig.AutoSize = true;
            this.rdb_richtig.Checked = true;
            this.rdb_richtig.Location = new System.Drawing.Point(33, 63);
            this.rdb_richtig.Name = "rdb_richtig";
            this.rdb_richtig.Size = new System.Drawing.Size(84, 17);
            this.rdb_richtig.TabIndex = 1;
            this.rdb_richtig.TabStop = true;
            this.rdb_richtig.Text = "sicher richtig";
            this.rdb_richtig.UseVisualStyleBackColor = true;
            this.rdb_richtig.CheckedChanged += new System.EventHandler(this.rdb_richtig_CheckedChanged);
            //
            // rdb_falsch
            //
            this.rdb_falsch.AutoSize = true;
            this.rdb_falsch.Location = new System.Drawing.Point(33, 105);
            this.rdb_falsch.Name = "rdb_falsch";
            this.rdb_falsch.Size = new System.Drawing.Size(84, 17);
            this.rdb_falsch.TabIndex = 2;
            this.rdb_falsch.Text = "sicher falsch";
            this.rdb_falsch.UseVisualStyleBackColor = true;
            this.rdb_falsch.CheckedChanged += new System.EventHandler(this.rdb_falsch_CheckedChanged);
            //
            // rdb_vielleicht
            //
            this.rdb_vielleicht.AutoSize = true;
            this.rdb_vielleicht.Location = new System.Drawing.Point(33, 147);
            this.rdb_vielleicht.Name = "rdb_vielleicht";
            this.rdb_vielleicht.Size = new System.Drawing.Size(97, 17);
            this.rdb_vielleicht.TabIndex = 3;
            this.rdb_vielleicht.Text = "vielleicht richtig";
            this.rdb_vielleicht.UseVisualStyleBackColor = true;
            this.rdb_vielleicht.CheckedChanged += new System.EventHandler(this.rdb_vielleicht_CheckedChanged);
            //
            // pic_1
            //
            this.pic_1.Image = global::check_it.Properties.Resources.owl;
            this.pic_1.Location = new System.Drawing.Point(171, 63);
            this.pic_1.Name = "pic_1";
            this.pic_1.Size = new System.Drawing.Size(100, 100);
            this.pic_1.TabIndex = 5;
            this.pic_1.TabStop = false;
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(305, 268);
            this.Controls.Add(this.pic_1);
            this.Controls.Add(this.rdb_vielleicht);
            this.Controls.Add(this.rdb_falsch);
            this.Controls.Add(this.rdb_richtig);
            this.Controls.Add(this.lbl_Frage);
            this.Controls.Add(this.btn_end);
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Check IT";
            ((System.ComponentModel.ISupportInitialize)(this.pic_1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion


<<zurück>>