如题
3Q各位大侠
3Q各位大侠
解决方案 »
- winform导入word
- 如何用编程实现:对文件夹的容量大小进行设置
- 控件循环移动出现间隔差的疑问
- datagridview1改變后的值
- 怎样通过进程等待检测webBrowser里的网页加载完毕?
- 对象名 'mekir_1.f_cid' 无效
- WinForm中具有TreeNode公共属性的类如何进行XML序列化?
- 请问这个问题怎么解决Server Error in '/' Application.
- C#里面调用C++的方法识别人的拳头
- 怎样验证文本框的文本符合"20030601"的日期格式?
- 如何通过子表的信息得到父表的内容
- ------------------------求求你给我个答案在线等待
==========================================
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace timecard
{
/// <summary>
/// about 的摘要说明。
/// </summary>
public class about : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Button button1;
[DllImport("kernel32.dll")]
public static extern bool Beep(int frequency, int duration);
[System.Runtime.InteropServices.DllImport("user32")]
private static extern bool AnimateWindow(IntPtr hwnd,int dwTime, int dwFlags);
const int AW_HOR_POSITIVE = 0x0001;
const int AW_HOR_NEGATIVE = 0x0002;
const int AW_VER_POSITIVE = 0x0004;
const int AW_VER_NEGATIVE = 0x0008;
const int AW_CENTER = 0x0010;
const int AW_HIDE = 0x10000;
const int AW_ACTIVATE = 0x20000;
const int AW_SLIDE = 0x40000;
const int AW_BLEND = 0x80000;
private System.ComponentModel.IContainer components; public about()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
} /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(about));
this.label1 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("华文行楷", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.Color.Purple;
this.label1.Location = new System.Drawing.Point(120, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(196, 32);
this.label1.TabIndex = 0;
this.label1.Text = "考 勤 管 理 系 统";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(372, 72);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(40, 40);
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
//
// label2
//
this.label2.Font = new System.Drawing.Font("隶书", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label2.Location = new System.Drawing.Point(12, 88);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(312, 24);
this.label2.TabIndex = 2;
this.label2.Text = "程序制作:张珂";
//
// label3
//
this.label3.Font = new System.Drawing.Font("隶书", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label3.Location = new System.Drawing.Point(12, 124);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(420, 24);
this.label3.TabIndex = 3;
this.label3.Text = "编写环境:WIN2KPROSP4+MSSQL2KSP4+MS.NET 1.14322SP1";
//
// label4
//
this.label4.Font = new System.Drawing.Font("隶书", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label4.Location = new System.Drawing.Point(12, 160);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(336, 20);
this.label4.TabIndex = 4;
this.label4.Text = "编写工具:MS VISUAL STUDIO.NET 2003(C#)";
//
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.button1.Location = new System.Drawing.Point(416, 4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(20, 20);
this.button1.TabIndex = 5;
this.button1.Text = "×";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// about
//
this.AcceptButton = this.button1;
this.AutoScaleBaseSize = new System.Drawing.Size(7, 16);
this.ClientSize = new System.Drawing.Size(440, 224);
this.Controls.Add(this.button1);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label1);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "about";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "about";
this.TopMost = true;
this.Closing += new System.ComponentModel.CancelEventHandler(this.about_Closing);
this.Load += new System.EventHandler(this.about_Load);
this.Activated += new System.EventHandler(this.about_Activated);
this.ResumeLayout(false); }
#endregion private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
} private void about_Load(object sender, System.EventArgs e)
{
AnimateWindow(this.Handle,200, AW_CENTER | AW_VER_NEGATIVE);
} private void about_Activated(object sender, System.EventArgs e)
{
} private void about_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
AnimateWindow(this.Handle,200, AW_HIDE | AW_BLEND );
timer1.Enabled=false;
} private void timer1_Tick(object sender, System.EventArgs e)
{
Random random = new Random();
Beep(random.Next(10000),100);
} }
}
using System.Runtime.InteropServices;然后
[DllImport("kernel32.dll")]
public static extern bool Beep(int frequency, int duration); //你的api然后就可以用了
DllImport("User32.dll")]
public static extern int MessageBox(int p,string msg,string cap,int type);
public static extern int MessageBox(int p,string msg,string cap,int type)
public static extern bool Beep(int frequency, int duration);
下面是API函数声明