登录
首页 » C# » messageBox居中父窗体

messageBox居中父窗体

于 2021-08-08 发布
0 189
下载积分: 1 下载次数: 1

代码说明:

自带的messagebox只能居中屏幕 ,改进后居中父窗体

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C++实战源码-上帝创世的秘密(入门级实例052).zip
    C++实战源码-上帝创世的秘密(入门级实例052).zip
    2019-10-01下载
    积分:1
  • 文本框搜索
    就是一个简单类似百度框搜索记忆的功能
    2014-10-30下载
    积分:1
  • C# 套打Demo
    套打Demo 【核心代码】using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Drawing.Printing;namespace Print_Demo{ public partial class Form1 : Form { public PrintDocument printDt = new PrintDocument(); //打印文档对象 Font printFont; //打印使用的字体 public Form1() { InitializeComponent(); } void printDt_PrintPage(object sender, PrintPageEventArgs e) { float pointX = 10; float pointY = 10; e.Graphics.DrawString("打印内容", new Font("宋体", 16F), Brushes.Black, pointX 60, pointY); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 26,pointX 300,pointY 26); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 35); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 56, pointX 300, pointY 56); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 65); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 86, pointX 300, pointY 86); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 95); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 116, pointX 300, pointY 116); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 125); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 146, pointX 300, pointY 146); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 155); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 176, pointX 300, pointY 176); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 185); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 206, pointX 300, pointY 206); e.Graphics.DrawString("检测结果", printFont, Brushes.Black, pointX, pointY 233); e.Graphics.DrawString("通过", new Font("宋体",22F,FontStyle.Bold), Brushes.Black, pointX 90, pointY 225); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 265, pointX 300, pointY 265); e.Graphics.DrawString("单位名称", printFont, Brushes.Black, pointX, pointY 275); } private void Form1_Load(object sender, EventArgs e) { printDt.PrintPage = new PrintPageEventHandler(printDt_PrintPage); printFont = new Font("宋体", 12F); } private void btnPrint_Click(object sender, EventArgs e) { //PrintDialog printDlg = new PrintDialog(); //printDlg.Document = printDt; //printDlg.AllowPrintToFile = true; //printDlg.AllowCurrentPage = true; //printDlg.AllowSelection = true; //printDlg.ShowDialog(); //printDlg.ShowDialog(); printDt.Print(); } private void btnLook_Click(object sender, EventArgs e) { PrintPreviewDialog printPreview = new PrintPreviewDialog(); printPreview.PrintPreviewControl.Document = printDt; printPreview.ShowDialog(this); } }}
    2021-05-06下载
    积分:1
  • 正则提取网页中的图片示例源码
    正则提取网页中的图片示例源码
    2014-04-01下载
    积分:1
  • c# 人事管理系统完整源码下载(考勤管理、简历管理)
    人事管理系统完整源码(含数据库),其中有 员工简历、考勤录入等功能 友情提示:附加数据库之后,修改 y.cn 中的数据库连接 即可使用(登录账号:10001  密码:123456) public y() { pobjConn.ConnectionString = "server=.;database=rsgl;uid=sa;pwd=sa"; }
    2014-12-18下载
    积分:1
  • 获取局域网IP和MAC地址 .txt
    C# 获取局域网IP和MAC地址
    2013-10-31下载
    积分:1
  • C++ 对象的内存布局
    【实例简介】 C 对象的内存布局
    2021-07-18 00:32:20下载
    积分:1
  • c#smtp发邮件代码
    c#smtp发邮件代码
    2015-06-16下载
    积分:1
  • C# 6.0 and the .NET 4.6 Framework(7th).pdf
    C#学习PDF
    2020-12-06下载
    积分:1
  • littleVGL 移植.pdf
    【实例简介】正点原子 littleVGL 开发指南
    2021-09-01 00:31:02下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载