要实现图片完全显示设置:BackgroundImageLayout=Stretch
效果图:
滚动条的制作:
1 把工具栏中拖panel到窗体里面,然后设置其属性AutoScroll=true;
2 把工具栏中的TextBox拖到panel中,要实现多行设置其属性Multiline=true
3 右边的功能看下面代码:
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);//文本格式
}
}
}