当前位置: 首页 > wzjs >正文

品牌型网站建设理论北京seo优化服务

品牌型网站建设理论,北京seo优化服务,公司网站要怎么做,怎样免费做网站项目场景: 在 WinForms 中制作 无边框窗体(FormBorderStyle None)时,默认失去了窗口的标题栏与边框,因此也失去了通过鼠标拖动移动和调整大小的能力。本例子通过一个标题栏来拖动窗体,通过状态栏右下角的…

项目场景:

在 WinForms 中制作 无边框窗体(FormBorderStyle = None)时,默认失去了窗口的标题栏与边框,因此也失去了通过鼠标拖动移动和调整大小的能力。本例子通过一个标题栏来拖动窗体,通过状态栏右下角的地方来拖动来改变窗体大小。本例子创建了两个窗体。一个baseform用来放标题栏和状态栏。

问题描述

提示:这里描述项目中遇到的问题:

难点是我窗体上被标题栏和状态栏dock之后很难选中

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace WindowsFormsApp1
{public partial class Form1: Form{public Form1(){InitializeComponent();panel1.MouseMove += panel1_MouseMove;panel1.MouseDown += panel1_MouseDown;panel1.MouseUp += Panel1_MouseUp;panel2.MouseDown += PanelTitle_MouseDown;this.DoubleBuffered = true;}[DllImport("user32.dll")]public static extern bool ReleaseCapture();[DllImport("user32.dll")]public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);public const int WM_NCLBUTTONDOWN = 0xA1;public const int HTCAPTION = 0x2;private void PanelTitle_MouseDown(object sender, MouseEventArgs e){if (e.Button == MouseButtons.Left){ReleaseCapture();SendMessage(this.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);}}private void Panel1_MouseUp(object sender, MouseEventArgs e){if (e.Button == MouseButtons.Left){this.Size = previousRect.Size;isResizing = false;}}private bool isResizing = false;private Point lastMousePos;private Size lastMouseSize;private Size NewMouseSize;private const int resizeArea = 15;private Rectangle previousRect;private void panel1_MouseMove(object sender, MouseEventArgs e){bool inBottomRight = e.X >= panel1.Width - resizeArea && e.Y >= panel1.Height - resizeArea;if (inBottomRight || isResizing)panel1.Cursor = Cursors.SizeNWSE;elsepanel1.Cursor = Cursors.Default;if (isResizing && e.Button == MouseButtons.Left){int dx = e.X - lastMousePos.X;int dy = e.Y - lastMousePos.Y;Size newSize = new Size(lastMouseSize.Width + dx,lastMouseSize.Height + dy);Rectangle newRect = new Rectangle(this.Location, newSize);previousRect = newRect;OnUpdateRichTextBox?.Invoke($" lastMousePos.X:{lastMousePos.X} lastMousePos.Y:{lastMousePos.Y} e.Y:{e.Y} e.X:{e.X}  dx:{dx}  dy:{dy}", Color.Black);}}private void panel1_MouseDown(object sender, MouseEventArgs e){if (e.Button == MouseButtons.Left &&e.X >= panel1.Width - resizeArea &&e.Y >= panel1.Height - resizeArea){lastMouseSize = this.Size;isResizing = true;lastMousePos = e.Location;}}public event Action<string , Color> OnUpdateRichTextBox;/// <summary>/// 改变richtextbox 当前插入行颜色/// </summary>/// <param name="rtBox"></param>/// <param name="addtext"></param>/// <param name="color"></param>/// <param name="IsaddNewLine"></parampublic void AppendTextColorful(RichTextBox rtBox, string addtext, Color color, bool IsaddNewLine = false){if (IsaddNewLine){addtext += Environment.NewLine;}try{if (rtBox.InvokeRequired){rtBox.Invoke(new Action(() =>{rtBox.ScrollToCaret();rtBox.SelectionStart = rtBox.TextLength;rtBox.SelectionLength = 0;rtBox.SelectionColor = color;rtBox.AppendText(DateTime.Now.ToString("yyyy:MM:dd HH:mm:ss:fff") + "  " + addtext + "\r\n");rtBox.SelectionColor = rtBox.ForeColor;if (rtBox.Lines.Length > 1000)rtBox.Clear();}));}else{rtBox.ScrollToCaret();rtBox.SelectionStart = rtBox.TextLength;rtBox.SelectionLength = 0;rtBox.SelectionColor = color;rtBox.AppendText(DateTime.Now.ToString("yyyy:MM:dd HH:mm:ss:fff") + addtext + "\r\n");rtBox.SelectionColor = rtBox.ForeColor;if (rtBox.Lines.Length > 1000)rtBox.Clear();}if (!Directory.Exists($"Log\\")){Directory.CreateDirectory($"Log\\");}//LoggerUtility.Instance.WriteLog(addtext, "normal");}catch (Exception ex){//LoggerUtility.Instance.WriteException(ex);}}}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace WindowsFormsApp1
{class Class1:Form1{private RichTextBox richTextBox1;public Class1(){InitializeComponent();OnUpdateRichTextBox += UpdateTextBox1;}//RichTextBox richTextBox1;private void UpdateTextBox1(string str, Color clr){AppendTextColorful(richTextBox1, str, clr);}private void InitializeComponent(){this.richTextBox1 = new System.Windows.Forms.RichTextBox();this.SuspendLayout();// // richTextBox1// this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;this.richTextBox1.Location = new System.Drawing.Point(0, 57);this.richTextBox1.Name = "richTextBox1";this.richTextBox1.Size = new System.Drawing.Size(1232, 503);this.richTextBox1.TabIndex = 2;this.richTextBox1.Text = "";// // Class1// this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);this.ClientSize = new System.Drawing.Size(1232, 606);this.Controls.Add(this.richTextBox1);this.Name = "Class1";this.Controls.SetChildIndex(this.richTextBox1, 0);this.ResumeLayout(false);}}
}
http://www.dtcms.com/wzjs/41946.html

相关文章:

  • 哪里有做网站较好的公司举一个病毒营销的例子
  • 分类目录的作用东莞网站优化
  • 企业整站推广品牌推广方案怎么写
  • 自动网站建设系统cms宁波seo网络推广多少钱
  • 创想ECS网站建设服务企业网站推广策划
  • 黄山旅游攻略作文化工seo顾问
  • 上海 网站建设平台 补贴找个免费网站这么难吗
  • 网站平台建设技术报告seo和sem的关系
  • 简述网站的设计流程是怎样的微信公众号运营推广方案
  • 杭州网站模板建站网站推广引流
  • wordpress 禁止过滤南宁seo
  • 网站建设方案对比分析报告接广告的平台
  • 电子商务网站开发教程俄罗斯搜索引擎浏览器官网入口
  • 网站建设具体步骤应该怎么做微信群免费推广平台
  • 北京赵公口网站建设网络营销策划书步骤
  • 昆明网络营销软件做灰色词seo靠谱
  • 网站留言板有什么用手机优化大师下载2022
  • 营销企业网站制作网站建设公司哪家好?
  • 泸州市建设局网站四川省人民政府官网
  • 网站可以做多语言的吗西安优化seo
  • 拼多多电商网站建设亚马逊关键词优化怎么做
  • 中国电力建设协会网站百度推广是什么意思
  • wordpress vps 256mseo就业
  • web前端工程师的发展趋势免费seo视频教程
  • 酒店网站建设考虑哪些因素网络营销工具有哪些?
  • 前端开发培训得多少钱seo网站推广经理招聘
  • 孝感58同城网站建设百度贴吧网页版登录
  • 浅谈网站建设开发软文推广产品
  • 金融类网站模板torrentkitty搜索引擎
  • 点开文字进入网站是怎么做的seo网络营销外包公司