您的位置:首页 > 其它

按钮应用(剪切,复制,粘贴)

2015-09-21 20:05 253 查看
要实现图片完全显示设置:BackgroundImageLayout=Stretch

效果图:



滚动条的***:

1 把工具栏中拖panel到窗体里面,然后设置其属性AutoScroll=true;

2 把工具栏中的TextBox拖到panel中,要实现多行设置其属性Multiline=true

3 右边的功能看下面代码:

[code]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 jianqie
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private String stext = "";//用于保存输入的文本

        private void button1_Click(object sender, EventArgs e)
        {
            stext = textBox1.SelectedText;//剪切
            textBox1.SelectedText = "";
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.SelectedText = stext;//粘贴
        }
        private void button2_Click(object sender, EventArgs e)
        {
            stext = textBox1.SelectedText;//复制
        }
        private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {
            Application.Exit();//退出
        }

        private void button4_Click(object sender, EventArgs e)
        {
            textBox1.Font = new Font("隶书", 16);//文本格式
        }
    }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: