26 Şubat 2016 Cuma

c# Dynamic Frame Design

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using FreeCodeLibrary;
namespace OgrenciOtomasyon
{
    class FrameState:Form
    {

        TextBox mX, mY;
        private string v;
        public FrameState(string v)
        {
            this.v = v;
            this.Text = v.ToString();
            SetBounds(45,20,500,500);
            this.Show();
            this.BackColor = Color.Gainsboro;
            Panel pane = new Panel();
            Button oku = new Button();
            oku.FlatStyle = FlatStyle.Popup;
            oku.BackColor = Color.Yellow;
            oku.Text =" Biz  C# ";
            oku.MouseClick += oku_MouseClick;
            pane.MouseMove += pane_MouseMove;
            mX = new TextBox();
            mY = new TextBox();
            mX.SetBounds(30, 60, 100, 100);
            mY.SetBounds(30, 90, 100, 100);
            pane.Controls.Add(mX);
            pane.Controls.Add(mY);
            oku.SetBounds(30,30,80,20);
            pane.BorderStyle=System.Windows.Forms.BorderStyle.Fixed3D;
            pane.SetBounds(50,50,200,200);
            pane.Controls.Add(oku);
            pane.BackColor = Color.LightCyan;
            this.Controls.Add(pane);
        }
        private void oku_MouseClick(Object sender, MouseEventArgs e)
        {
             MessageBox.Show(Cmath.Sum(5,6,7,5,8).ToString());
         
        }
        private void pane_MouseMove(Object sender, MouseEventArgs e)
        {
            mX.Text = e.X.ToString();
            mY.Text = e.Y.ToString();
        }
    }
}

Hiç yorum yok:

Yorum Gönder

Lütfen yorumlarınızı iletiniz...