2014年12月1日 星期一

C# 移動和彈出視窗

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 WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("你好嗎?");
            //彈出視窗顯示你好嗎?
        }

        private void button2_Click(object sender, EventArgs e)
        {
            button1.Location = new Point(100, 100);
            //按button2把button1移動到(100,100)
        }
    }

沒有留言:

張貼留言