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

怀化职院网站品牌策划书模板范文

怀化职院网站,品牌策划书模板范文,公司网站开发费计入,更新wordpress目录 (1)ReleaseCapture函数 (2)SendMessage函数 (3)实例 1.Resources.Designer.cs 2.Form1.Designer.cs 3.Form1.cs 一般情况下#xff0c;在标题栏中按住鼠标左键不放即可实现拖动操作。 当做浮动窗体时#xff0c;如果包含窗体边框#xff0c;那么界面给使用者的感…目录 (1)ReleaseCapture函数 (2)SendMessage函数 (3)实例 1.Resources.Designer.cs 2.Form1.Designer.cs 3.Form1.cs 一般情况下在标题栏中按住鼠标左键不放即可实现拖动操作。 当做浮动窗体时如果包含窗体边框那么界面给使用者的感觉将很不友好因此浮动窗体没有边框但对于这种没有边框的窗体该如何进行拖放操作呢? 主要用Windows的两个API函数即ReleaseCapture和SendMessage来实现 (1)ReleaseCapture函数 该函数用来释放被当前线程中某个窗口捕获的光标。语法格式如下 [DllImport(user32.dll)] public static extern bool ReleaseCapture(); (2)SendMessage函数 该函数用来向指定的窗体发送Windows消息。语法格式如下 [DllImport(user32.dll)] public static extern bool SendMessage(IntPtr hwdn,int wMsg,int mParam,int lParam); (3)实例 本实例鼠标落于窗体上在UP之前随意拖拽窗体到任意位置。 1.Resources.Designer.cs //------------------------------------------------------------------------------ // auto-generated // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 // // 对此文件的更改可能会导致不正确的行为并且如果 // 重新生成代码这些更改将会丢失。 // /auto-generated //------------------------------------------------------------------------------namespace _198.Properties {using System;/// summary/// 一个强类型的资源类用于查找本地化的字符串等。/// /summary// 此类是由 StronglyTypedResourceBuilder// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。// 若要添加或移除成员请编辑 .ResX 文件然后重新运行 ResGen// (以 /str 作为命令选项)或重新生成 VS 项目。[global::System.CodeDom.Compiler.GeneratedCodeAttribute(System.Resources.Tools.StronglyTypedResourceBuilder, 17.0.0.0)][global::System.Diagnostics.DebuggerNonUserCodeAttribute()][global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]internal class Resources {private static global::System.Resources.ResourceManager resourceMan;private static global::System.Globalization.CultureInfo resourceCulture;[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(Microsoft.Performance, CA1811:AvoidUncalledPrivateCode)]internal Resources() {}/// summary/// 返回此类使用的缓存的 ResourceManager 实例。/// /summary[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]internal static global::System.Resources.ResourceManager ResourceManager {get {if (object.ReferenceEquals(resourceMan, null)) {global::System.Resources.ResourceManager temp new global::System.Resources.ResourceManager(_198.Properties.Resources, typeof(Resources).Assembly);resourceMan temp;}return resourceMan;}}/// summary/// 重写当前线程的 CurrentUICulture 属性对/// 使用此强类型资源类的所有资源查找执行重写。/// /summary[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]internal static global::System.Globalization.CultureInfo Culture {get {return resourceCulture;}set {resourceCulture value;}}/// summary/// 查找 System.Drawing.Bitmap 类型的本地化资源。/// /summaryinternal static System.Drawing.Bitmap _04 {get {object obj ResourceManager.GetObject(_04, resourceCulture);return ((System.Drawing.Bitmap)(obj));}}} }2.Form1.Designer.cs namespace _198 {partial class Form1{/// summary/// Required designer variable./// /summaryprivate System.ComponentModel.IContainer components null;/// summary/// Clean up any resources being used./// /summary/// param namedisposingtrue if managed resources should be disposed; otherwise, false./paramprotected override void Dispose(bool disposing){if (disposing (components ! null)){components.Dispose();}base.Dispose(disposing);}#region Windows Form Designer generated code/// summary/// Required method for Designer support - do not modify/// the contents of this method with the code editor./// /summaryprivate void InitializeComponent(){SuspendLayout();// // Form1// AutoScaleDimensions new SizeF(7F, 17F);AutoScaleMode AutoScaleMode.Font;BackgroundImage Properties.Resources._04;BackgroundImageLayout ImageLayout.Stretch;ClientSize new Size(311, 218);FormBorderStyle FormBorderStyle.None;Name Form1;Text Form1;MouseDown Form1_MouseDown;ResumeLayout(false);}#endregion} }3.Form1.cs 实例中使用的API函数 [DllImport(user32.dll)]会提示CA1401和SYSLIB1054的错误消息提示不要理睬否则生成的窗体不能实现拖拽。按道理讲按照提示修改更新为最新的API函数P/INVOKE应该是能正常工作的可是我没有心情去调试它了感兴趣的网友见到后可以深入研究并攻克它趟有结果还请回复。我用的框架是.NET8.0。 // 拖拽无边框浮动窗体 using System.Runtime.InteropServices; namespace _198 {public partial class Form1 : Form{#region 本程序中用到的API函数[DllImport(user32.dll)]public static extern bool ReleaseCapture();//用来释放被当前线程中某个窗口捕获的光标[DllImport(user32.dll)]public static extern bool SendMessage(IntPtr hwdn, int wMsg, int mParam, int lParam);//向指定的窗体发送Windows消息#endregion#region 本程序中需要声明的变量public const int WM_SYSCOMMAND 0x0112; //该变量表示将向Windows发送的消息类型public const int SC_MOVE 0xF010; //该变量表示发送消息的附加消息public const int HTCAPTION 0x0002; //该变量表示发送消息的附加消息#endregionpublic Form1(){InitializeComponent();}/// summary/// 鼠标落在窗体上随意拖拽/// /summaryprivate void Form1_MouseDown(object sender, MouseEventArgs e){ReleaseCapture(); //用来释放被当前线程中某个窗口捕获的光标SendMessage(Handle, WM_SYSCOMMAND, SC_MOVE HTCAPTION, 0); //向Windows发送拖动窗体的消息}} }
http://www.zqtcl.cn/news/189199/

相关文章:

  • 三门峡市住房的城乡建设局网站百度指数分析官网
  • 新网站外链怎么做陕西省煤炭建设第一中学官方网站
  • 学校网站建设方面汇报php网站开发和部署
  • 源码建站和模板建站区别商城网站功能
  • 临沂建站公司互联网开网站怎么做
  • 有哪个网站做ic购物网站建设需求
  • 怎么登录甘肃省建设厅网站工信部域名信息备案管理系统查询
  • 怎么才能免费建网站网站套利怎么做
  • .win域名做网站怎么样邯郸的互联网公司
  • 企业网站建设推广实训报告网站目录
  • 找做课件的网站网站建设柒首先金手指9
  • 秦皇岛网站建设公司wordpress百度编辑器
  • 潍坊网站建设联系方式农业网站开发
  • 河北网站制作网站设计依赖于什么设计
  • 深圳网站优化培训wordpress内页关键词
  • 上栗网站建设企业网站建设报价方案
  • 广州网站开发公司公司级别网站开发
  • 做网站备案哪些条件怎样选择网站的关键词
  • 有没有专门做名片的网站忘记网站后台账号
  • 重庆建设工程招标网站印尼建设银行网站
  • 什么是网站流量优化四川住房建设厅网站
  • 现在还有企业做网站吗做百度推广送的网站
  • 公司年前做网站好处互联网推广运营是做什么的
  • 公司网站建设杭州钓鱼网站制作的报告
  • 宁海有做网站的吗网络规划设计师需要掌握哪些
  • 百度云注册域名可以做网站明码有了主机如何做网站
  • 门户网站推广方案连云港市电信网站建设
  • 网站程序如何制作app商城开发价格
  • 用易语言做攻击网站软件国药控股北京有限公司
  • 宁津 做网站湛江招聘网最新招聘