实验要求:
1.窗体启动后自动位于屏幕中央,大小不可调,背景色为白色
2.烟台大学的链接标签,字体宋体16.
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 Form1_Load(object sender, EventArgs e)
{
CenterToScreen();
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.BackColor = Color.White;
linkLabel1.Font = new System.Drawing.Font("宋体", 16);
linkLabel1.Text = "烟台大学";
linkLabel1.Links[0].LinkData = "http://www.ytu.edu.cn";
}
private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(e.Link.LinkData.ToString());
}
}
}