Form1.cs

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 手动改变自制窗体的大小
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

public static int Example_X = 0;
        public static int Example_Y = 0;
        public static int Example_W = 0;
        public static Point CPoint;

#region  利用窗体上的控件移动窗体
        /// <summary>
        /// 利用控件移动窗体
        /// </summary>
        /// <param Frm="Form">窗体</param>
        /// <param e="MouseEventArgs">控件的移动事件</param>
        public void FrmMove(Form Frm, MouseEventArgs e)  //Form或MouseEventArgs添加命名空间using System.Windows.Forms;
        {
            if (e.Button == MouseButtons.Left)
            {
                Point myPosittion = Control.MousePosition;//获取当前鼠标的屏幕坐标
                myPosittion.Offset(CPoint.X, CPoint.Y);//重载当前鼠标的位置
                Frm.DesktopLocation = myPosittion;//设置当前窗体在屏幕上的位置
            }
        }
        #endregion

#region  获取鼠标的当前位置
        /// <summary>
        /// 获取鼠标的当前位置
        /// </summary>
        /// <param Frm="Form">窗体</param>
        /// <param e="MouseEventArgs">窗体上有关鼠标的一些信息</param>
        public void FrmScreen_SizeInfo(Form Frm, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Example_X = e.X;
                Example_Y = e.Y;
                Example_W = Frm.Width;
            }
        }
        #endregion

#region  改变窗体的大小(用于鼠标的移动事件)
        /// <summary>
        /// 改变窗体的大小(用于鼠标的移动事件)
        /// </summary>
        /// <param Frm="Form">窗体</param>
        /// <param Pan="Panel">设置窗体边框的控件</param>
        /// <param e="MouseEventArgs">窗体上有关鼠标的一些信息</param>
        public void FrmScreen_EnlargeSize(Form Frm, Panel Pan, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                switch (Pan.Name)
                {
                    case "panel_Right":                        //如果移动的是窗体的右边框
                        {
                            if (this.Width <= 70)                //如果窗体的宽度小于等于70
                            {
                                Frm.Width = 70;                //设置窗体的宽度为70
                                //如果用鼠标向右移动窗体的右边框
                                if (Cursor.Position.X - Frm.Left + (Pan.Width - Example_X) > Frm.Width)
                                {
                                    //根据鼠标的移动值,增加窗体的宽度
                                    Frm.Width = Cursor.Position.X - Frm.Left + (Pan.Width - Example_X);
                                }
                                break;
                            }
                            //根据鼠标的移动值,增加窗体的宽度
                            Frm.Width = Cursor.Position.X - Frm.Left + (Pan.Width - Example_X);
                            break;
                        }
                    case "panel_BR":                        //如果移动的是窗体的右下角
                        {
                            //如果窗体的大小不为窗体大小的最小值
                            if (this.Width > 70 && this.Height > (panel_Title.Height + panel_Bn.Height + 1))
                            {
                                //根据鼠标的移动改变窗体的大小
                                Frm.Height = Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y);
                                Frm.Width = Cursor.Position.X - Frm.Left + (Pan.Width - Example_X);
                            }
                            else
                            {
                                if (this.Width <= 70)            //如果窗体的宽度小于等于最小值
                                {
                                    Frm.Width = 70;            //设置窗体的宽度为70
                                    if (this.Height <= (panel_Title.Height + panel_Bn.Height + 1))//如果窗体的高小于最小值
                                    {
                                        Frm.Height = panel_Title.Height + panel_Bn.Height + 1;//设置窗体的最小高度
                                        //如果用鼠标向下移动窗体的底边框
                                        if (Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y) > Frm.Height)
                                        {
                                            //根据鼠标的移动值,增加窗体的高度
                                            Frm.Height = Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y);
                                        }
                                        break;
                                    }
                                    //如果用鼠标向右移动窗体
                                    if (Cursor.Position.X - Frm.Left + (Pan.Width - Example_X) > Frm.Width)
                                    {
                                        //增加窗体的宽度
                                        Frm.Width = Cursor.Position.X - Frm.Left + (Pan.Width - Example_X);
                                    }
                                    break;
                                }
                                if (this.Height <= (panel_Title.Height + panel_Bn.Height + 1))//如果窗体的高度小于等于最小值
                                {
                                    Frm.Height = panel_Title.Height + panel_Bn.Height + 1;//设置窗体的高度为最小值
                                    Frm.Width = Cursor.Position.X - Frm.Left + (Pan.Width - Example_X);//改变窗体的宽度
                                    //如果用鼠标向下移动窗体的边框
                                    if (Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y) > Frm.Height)
                                    {
                                        Frm.Height = Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y);//增加窗体的高度
                                    }
                                    break;
                                }
                            }
                            break;
                        }
                    case "panel_Bn"://如果移动的是窗体的底边框
                        {
                            if (this.Height <= (panel_Title.Height + panel_Bn.Height + 1))//如果窗体的高度小于等于最小值
                            {
                                Frm.Height = panel_Title.Height + panel_Bn.Height + 1;//设置窗体的高度为最小值
                                //如果用鼠标向下移动窗体的下边框
                                if (Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y) > Frm.Height)
                                {
                                    Frm.Height = Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y);    //增加窗体的高度
                                }
                                break;
                            }
                            Frm.Height = Cursor.Position.Y - Frm.Top + (Pan.Height - Example_Y);            //增加窗体的高度
                            break;
                        }
                }
            }
        }
        #endregion

private void panel_Right_MouseDown(object sender, MouseEventArgs e)
        {
            FrmScreen_SizeInfo(this, e);//获取鼠标的当前位置
        }

private void panel_Right_MouseMove(object sender, MouseEventArgs e)
        {
            FrmScreen_EnlargeSize(this, (Panel)sender, e);//改变窗体的大小
        }

private void pictureBox1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

private void panel_TitL_MouseDown(object sender, MouseEventArgs e)
        {
            int Tem_X = -e.X;
            if (Convert.ToInt16(((Panel)sender).Tag.ToString()) == 2)//如果移动的是标题栏的中间部分
                Tem_X = -e.X - panel_TitL.Width;
            if (Convert.ToInt16(((Panel)sender).Tag.ToString()) == 3)//如果移动的是标题栏的尾端
                Tem_X = -(this.Width - ((Panel)sender).Width) - e.X;
            CPoint = new Point(Tem_X, -e.Y);
        }

private void panel_TitL_MouseMove(object sender, MouseEventArgs e)
        {
            FrmMove(this, e);
        }

}
}

Form1.Designer.cs

namespace 手动改变自制窗体的大小
{
    partial class Form1
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

/// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

#region Windows 窗体设计器生成的代码

/// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.panel_BR = new System.Windows.Forms.Panel();
            this.panel_All = new System.Windows.Forms.Panel();
            this.panel_TitR = new System.Windows.Forms.Panel();
            this.panel_BL = new System.Windows.Forms.Panel();
            this.panel_TitZ = new System.Windows.Forms.Panel();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.panel_TitL = new System.Windows.Forms.Panel();
            this.panel_Right = new System.Windows.Forms.Panel();
            this.panel_Left = new System.Windows.Forms.Panel();
            this.panel_Title = new System.Windows.Forms.Panel();
            this.panel_Bottom = new System.Windows.Forms.Panel();
            this.panel_Bn = new System.Windows.Forms.Panel();
            this.panel_TitZ.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.panel_Title.SuspendLayout();
            this.panel_Bottom.SuspendLayout();
            this.SuspendLayout();
            //
            // panel_BR
            //
            this.panel_BR.BackColor = System.Drawing.Color.Transparent;
            this.panel_BR.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_BR.BackgroundImage")));
            this.panel_BR.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.panel_BR.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
            this.panel_BR.Dock = System.Windows.Forms.DockStyle.Right;
            this.panel_BR.Location = new System.Drawing.Point(284, 0);
            this.panel_BR.Name = "panel_BR";
            this.panel_BR.Size = new System.Drawing.Size(8, 10);
            this.panel_BR.TabIndex = 1;
            this.panel_BR.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseMove);
            this.panel_BR.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseDown);
            //
            // panel_All
            //
            this.panel_All.BackColor = System.Drawing.Color.Honeydew;
            this.panel_All.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel_All.Location = new System.Drawing.Point(6, 19);
            this.panel_All.Name = "panel_All";
            this.panel_All.Size = new System.Drawing.Size(280, 96);
            this.panel_All.TabIndex = 13;
            //
            // panel_TitR
            //
            this.panel_TitR.BackColor = System.Drawing.Color.Transparent;
            this.panel_TitR.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_TitR.BackgroundImage")));
            this.panel_TitR.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.panel_TitR.Dock = System.Windows.Forms.DockStyle.Right;
            this.panel_TitR.Location = new System.Drawing.Point(284, 0);
            this.panel_TitR.Name = "panel_TitR";
            this.panel_TitR.Size = new System.Drawing.Size(8, 19);
            this.panel_TitR.TabIndex = 1;
            this.panel_TitR.Tag = "3";
            this.panel_TitR.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_TitL_MouseMove);
            this.panel_TitR.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_TitL_MouseDown);
            //
            // panel_BL
            //
            this.panel_BL.BackColor = System.Drawing.Color.Transparent;
            this.panel_BL.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_BL.BackgroundImage")));
            this.panel_BL.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.panel_BL.Cursor = System.Windows.Forms.Cursors.SizeNS;
            this.panel_BL.Dock = System.Windows.Forms.DockStyle.Left;
            this.panel_BL.Location = new System.Drawing.Point(0, 0);
            this.panel_BL.Name = "panel_BL";
            this.panel_BL.Size = new System.Drawing.Size(8, 10);
            this.panel_BL.TabIndex = 0;
            //
            // panel_TitZ
            //
            this.panel_TitZ.BackColor = System.Drawing.Color.Transparent;
            this.panel_TitZ.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_TitZ.BackgroundImage")));
            this.panel_TitZ.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.panel_TitZ.Controls.Add(this.pictureBox1);
            this.panel_TitZ.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel_TitZ.Location = new System.Drawing.Point(12, 0);
            this.panel_TitZ.Name = "panel_TitZ";
            this.panel_TitZ.Size = new System.Drawing.Size(272, 19);
            this.panel_TitZ.TabIndex = 2;
            this.panel_TitZ.Tag = "2";
            this.panel_TitZ.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_TitL_MouseMove);
            this.panel_TitZ.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_TitL_MouseDown);
            //
            // pictureBox1
            //
            this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
            this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            this.pictureBox1.Location = new System.Drawing.Point(260, 3);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(11, 11);
            this.pictureBox1.TabIndex = 0;
            this.pictureBox1.TabStop = false;
            this.pictureBox1.Tag = "11";
            this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
            //
            // panel_TitL
            //
            this.panel_TitL.BackColor = System.Drawing.Color.Transparent;
            this.panel_TitL.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_TitL.BackgroundImage")));
            this.panel_TitL.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.panel_TitL.Dock = System.Windows.Forms.DockStyle.Left;
            this.panel_TitL.Location = new System.Drawing.Point(0, 0);
            this.panel_TitL.Name = "panel_TitL";
            this.panel_TitL.Size = new System.Drawing.Size(12, 19);
            this.panel_TitL.TabIndex = 0;
            this.panel_TitL.Tag = "1";
            this.panel_TitL.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_TitL_MouseMove);
            this.panel_TitL.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_TitL_MouseDown);
            //
            // panel_Right
            //
            this.panel_Right.BackColor = System.Drawing.Color.Transparent;
            this.panel_Right.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Right.BackgroundImage")));
            this.panel_Right.Cursor = System.Windows.Forms.Cursors.SizeWE;
            this.panel_Right.Dock = System.Windows.Forms.DockStyle.Right;
            this.panel_Right.Location = new System.Drawing.Point(286, 19);
            this.panel_Right.Name = "panel_Right";
            this.panel_Right.Size = new System.Drawing.Size(6, 96);
            this.panel_Right.TabIndex = 10;
            this.panel_Right.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseMove);
            this.panel_Right.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseDown);
            //
            // panel_Left
            //
            this.panel_Left.BackColor = System.Drawing.Color.Transparent;
            this.panel_Left.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Left.BackgroundImage")));
            this.panel_Left.Dock = System.Windows.Forms.DockStyle.Left;
            this.panel_Left.Location = new System.Drawing.Point(0, 19);
            this.panel_Left.Name = "panel_Left";
            this.panel_Left.Size = new System.Drawing.Size(6, 96);
            this.panel_Left.TabIndex = 9;
            this.panel_Left.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseMove);
            this.panel_Left.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseDown);
            //
            // panel_Title
            //
            this.panel_Title.BackColor = System.Drawing.Color.Transparent;
            this.panel_Title.Controls.Add(this.panel_TitZ);
            this.panel_Title.Controls.Add(this.panel_TitR);
            this.panel_Title.Controls.Add(this.panel_TitL);
            this.panel_Title.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel_Title.Location = new System.Drawing.Point(0, 0);
            this.panel_Title.Name = "panel_Title";
            this.panel_Title.Size = new System.Drawing.Size(292, 19);
            this.panel_Title.TabIndex = 7;
            //
            // panel_Bottom
            //
            this.panel_Bottom.BackColor = System.Drawing.Color.Transparent;
            this.panel_Bottom.Controls.Add(this.panel_Bn);
            this.panel_Bottom.Controls.Add(this.panel_BR);
            this.panel_Bottom.Controls.Add(this.panel_BL);
            this.panel_Bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel_Bottom.Location = new System.Drawing.Point(0, 115);
            this.panel_Bottom.Name = "panel_Bottom";
            this.panel_Bottom.Size = new System.Drawing.Size(292, 10);
            this.panel_Bottom.TabIndex = 8;
            //
            // panel_Bn
            //
            this.panel_Bn.BackColor = System.Drawing.Color.Transparent;
            this.panel_Bn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Bn.BackgroundImage")));
            this.panel_Bn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.panel_Bn.Cursor = System.Windows.Forms.Cursors.SizeNS;
            this.panel_Bn.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel_Bn.Location = new System.Drawing.Point(8, 0);
            this.panel_Bn.Name = "panel_Bn";
            this.panel_Bn.Size = new System.Drawing.Size(276, 10);
            this.panel_Bn.TabIndex = 2;
            this.panel_Bn.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseMove);
            this.panel_Bn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_Right_MouseDown);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(292, 125);
            this.Controls.Add(this.panel_All);
            this.Controls.Add(this.panel_Right);
            this.Controls.Add(this.panel_Left);
            this.Controls.Add(this.panel_Title);
            this.Controls.Add(this.panel_Bottom);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name = "Form1";
            this.Text = "Form1";
            this.panel_TitZ.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.panel_Title.ResumeLayout(false);
            this.panel_Bottom.ResumeLayout(false);
            this.ResumeLayout(false);

}

#endregion

private System.Windows.Forms.Panel panel_BR;
        private System.Windows.Forms.Panel panel_All;
        private System.Windows.Forms.Panel panel_TitR;
        private System.Windows.Forms.Panel panel_BL;
        private System.Windows.Forms.Panel panel_TitZ;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.Panel panel_TitL;
        private System.Windows.Forms.Panel panel_Right;
        private System.Windows.Forms.Panel panel_Left;
        private System.Windows.Forms.Panel panel_Title;
        private System.Windows.Forms.Panel panel_Bottom;
        private System.Windows.Forms.Panel panel_Bn;
    }
}

Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace 手动改变自制窗体的大小
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

C#手动改变自制窗体的大小的更多相关文章

  1. CSS手动改变DIV高宽

    本实例代码可以使DIV可以手动改变大小 效果体验:http://hovertree.com/code/css/resize.htm 代码如下: <!DOCTYPE html> <ht ...

  2. datagridview随窗体的大小而变,表格填满控件

    在C#winform布局的时候,我们拖一个datagridview到窗体上面,将datagridview调整为适合窗体的大小,但是我们运行之后,点击最大化按钮的时候,却发现datagridview的大 ...

  3. 运行时改变控件的大小(点击后立刻ReleaseCapture,然后计算位移,最后发消息改变位置)——最有趣的是TPanel其实也有窗口标题,因此可发HTCAPTION消息

    //光标在控件不同位置时的样式 // 由于拐角这点手动精确实在困难 所以用范围 范围+3 这样很容易就找到这一点了 procedure CtrlMouseMove(Ctrl: TWinControl; ...

  4. MFC中改变控件的大小和位置(zz)

    用CWnd类的函数MoveWindow()或SetWindowPos()能够改变控件的大小和位置. void MoveWindow(int x,int y,int nWidth,int nHeight ...

  5. netbeans 窗体字体大小设置

    当计算机分辨率变大的时候,打开netbeans的时候,字体就会变得越来越小 看起来很不爽,所要就要改变一下,窗体字体大小. 在网上找到了一段修改netbeans窗体字体大小的配置信息,现标记起来,以便 ...

  6. MFC中改变控件的大小和位置

    用CWnd类的函数MoveWindow()或SetWindowPos()可以改变控件的大小和位置. void MoveWindow(int x,int y,int nWidth,int nHeight ...

  7. C#-禁止调整窗体的大小

    要是想禁止调整窗体的大小,可以查看:FormBorderStyle属性,该属性的设置中有一个"FixedSingle"的选择项,它可以禁止调整窗体的大小.

  8. 居然还有WM_TIMECHANGE(只在用户手动改变系统时间时才会产生作用)

    unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  9. vim改变多窗口的大小

    摘自:http://blog.163.com/lgh_2002/blog/static/44017526201031671927647/ vim改变多窗口的大小 VIM改变窗口大小 *window-r ...

随机推荐

  1. c# System.Object类和数据的安全转型

    .NET Fraework 最重要的引用类型之一是System命名空间中Object类.所有的类都是System.Object的派生类.System.Object类型的变量System.Object的 ...

  2. git忽略某些文件的几种方法

    不知道为什么我记得我写过这个内容但是又找不到了,只好照着大致记忆写一下以备留存. 1.首先肯定是.gitignore文件 .gitignore文件适合在文件尚未被追踪时加入,将其忽略便可以不上传到远程 ...

  3. Linux基础命令---lpstat查看打印任务

    lpstat lpstat指令用来显示当前任务.打印机的状态.如果没有参数,那么就显示打印队列. 此命令的适用范围:RedHat.RHEL.Ubuntu.CentOS.Fedora.openSUSE. ...

  4. qemu 对虚机的地址空间管理

    转载:http://huchh.com/2015/06/22/qemu-%E5%AF%B9%E8%99%9A%E6%9C%BA%E7%9A%84%E7%BA%BF%E6%80%A7%E5%9C%B0% ...

  5. C++找不出来的bug

    1.在函数中给指针赋值时候要极其注意: 新生成的指针要么是new出来的,要么是全局的,要么是传参过来的... 就是要切记在函数局部生成一个新指针,这样的话,出了这个函数,局部的新指针所具体代表的值就被 ...

  6. 剑指offer(57)二叉树的下一个节点

    题目描述 给定一个二叉树和其中的一个结点,请找出中序遍历顺序的下一个结点并且返回.注意,树中的结点不仅包含左右子结点,同时包含指向父结点的指针. 题目分析 这题一定要画图,因为只有画图我们才能分清楚下 ...

  7. newcoder 小A的柱状图(单调栈)题解

    题目描述 柱状图是有一些宽度相等的矩形下端对齐以后横向排列的图形,但是小A的柱状图却不是一个规范的柱状图,它的每个矩形下端的宽度可以是不相同的一些整数,分别为a[i] 每个矩形的高度是h[i] ,现在 ...

  8. 【2.0】SpringBoot2配置Druid数据源及监控

    什么是Druid? Druid首先是Java语言中最好的数据库连接池,也是阿里巴巴的开源项目.Druid是阿里巴巴开发的号称为监控而生的数据库连接池,在功能.性能.扩展性方面,都超过其他数据库连接池, ...

  9. 【问题解决:信息提示】SpringBoot启动时提示The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

    问题描述 springboot程序在启动时提示信息 [2018-10-24 21:59:05.214] - 440 信息 [restartedMain] --- org.apache.catalina ...

  10. MyEclipse运行Java出错:could not find the main class:test.program will exit(导入项目)

    自己新建的项目运行没有任何问题.但是我导入的很早以前别人写的项目,然后run就会弹框could not find the main class:test.program will exit 请确认JA ...