• 大小: 2.75MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-08
  • 语言: C#
  • 标签: c#  

资源简介

c#网络高级编程的源码,与课程教学相对应!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MouseDrawline
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            //创建绘图对象
            g = this.pictureBox1.CreateGraphics();
        }

        //定义画线起点X、Y坐标
        int LineStartX = 0;
        int LineStartY = 0;
        //移动并“按下鼠标”才可画线
        bool blDrawLine = false;
        //定义绘图对象
        Graphics g;      

        //初置画线起点以便鼠标移动时画线
        private void pictureBox1_MouseDown(object sender System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                //画线起点
                LineStartX = e.X;
                LineStartY = e.Y; 
                blDrawLine = true;
            }
        }

        //画线
        private void pictureBox1_MouseMove(object sender System.Windows.Forms.MouseEventArgs e)
        {
            //判断是否可以画线
            if (blDrawLine)
            {
                //创建一个2像素宽的蓝色画笔
                Pen p = new Pen(Color.Blue2);
                //开始画线
                g.DrawLine(p LineStartX LineStartY e.X e.Y);
                //重置画线起点
                LineStartX = e.X;
                LineStartY = e.Y;
            }
        }

        //取消画线
        private void pictureBox1_MouseUp(object sender System.Windows.Forms.MouseEventArgs e)
        {
            blDrawLine = false;
        }

        //清除画线
        private void button1_Click(object sender EventArgs e)
        {
            pictureBox1.Refresh();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1941  2010-04-19 10:08  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Form1.cs

     文件       3173  2010-04-19 09:40  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Form1.Designer.cs

     文件       5814  2010-04-19 09:40  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Form1.resx

     文件       3338  2010-04-19 08:58  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\MouseDrawline.csproj

     文件        472  2010-04-19 08:45  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Program.cs

     文件       1198  2010-04-19 08:45  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Properties\AssemblyInfo.cs

     文件       2848  2010-04-19 08:58  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Properties\Resources.Designer.cs

     文件       5957  2010-04-19 08:58  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Properties\Resources.resx

     文件       1096  2010-04-19 08:45  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Properties\Settings.Designer.cs

     文件        249  2010-04-19 08:45  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline\Properties\Settings.settings

     文件        928  2010-04-19 08:45  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline.sln

    ..A..H.     28672  2010-04-19 10:40  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\Backup\MouseDrawline.suo

     文件       9216  2014-01-09 14:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\bin\Debug\MouseDrawline.exe

     文件      30208  2014-01-09 14:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\bin\Debug\MouseDrawline.pdb

     文件      14328  2014-01-10 08:19  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\bin\Debug\MouseDrawline.vshost.exe

     文件        490  2009-06-11 05:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\bin\Debug\MouseDrawline.vshost.exe.manifest

     文件       1941  2010-04-19 10:08  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\Form1.cs

     文件       3173  2010-04-19 09:40  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\Form1.Designer.cs

     文件       5814  2010-04-19 09:40  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\Form1.resx

     文件       3509  2014-01-07 11:33  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\MouseDrawline.csproj

     文件       1118  2014-01-10 08:19  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\Debug\MouseDrawline.csproj.FileListAbsolute.txt

     文件        774  2014-01-09 14:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\Debug\MouseDrawline.csproj.GenerateResource.Cache

     文件       9216  2014-01-09 14:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\Debug\MouseDrawline.exe

     文件        180  2014-01-09 14:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\Debug\MouseDrawline.Form1.resources

     文件      30208  2014-01-09 14:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\Debug\MouseDrawline.pdb

     文件        180  2014-01-09 14:14  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\Debug\MouseDrawline.Properties.Resources.resources

     文件       4608  2014-01-07 11:33  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件        310  2010-04-19 10:05  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\obj\MouseDrawline.csproj.FileList.txt

     文件        472  2010-04-19 08:45  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\Program.cs

     文件       1198  2010-04-19 08:45  《C#语言Windows程序设计》源码\chpt10\chpt10-1\MouseDrawline\MouseDrawline\Properties\AssemblyInfo.cs

............此处省略1158个文件信息

评论

共有 条评论