我一直在玩.,在没有视觉演播室的情况下制作很少的窗户。
我在附注pad++中创建了我的消息来源,并编集了一台NAnt建筑材料。
当我管理申请时,还展示了指挥窗口以及应用窗口。 我怎么能防止指挥窗口的出现?
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Media;
using System.IO;
namespace mynamespace
{
class MyForm : Form
{
public Button btnPlay;
MyForm()
{
this.SuspendLayout();
this.Text = "My Application";
InitialiseForm();
this.ResumeLayout(false);
}
private void InitialiseForm()
{
btnPlay = new Button();
btnPlay.Location = new System.Drawing.Point(30,40);
btnPlay.Text = "Play";
btnPlay.Click += new System.EventHandler(btnPlay_Click);
this.Controls.Add(btnPlay);
}
protected void btnPlay_Click(object sender, EventArgs e)
{
string wav = "testing123.wav";
Stream resourceStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(wav);
SoundPlayer player = new SoundPlayer(resourceStream);
player.Play();
}
public static void Main()
{
Application.Run(new MyForm());
}
}
}
1. 建立档案
<?xml version="1.0"?>
<project name="myform" default="build" basedir=".">
<description>My Form app</description>
<property name="debug" value="true" overwrite="false"/>
<target name="clean" description="Remove all generated files">
<delete dir="build"/>
</target>
<target name="build" description="Compile the source" depends="clean">
<mkdir dir="build"/>
<csc target="exe" output="buildMyForm.exe" debug="${debug}" verbose="true">
<resources>
<include name="app
esources*.wav" />
</resources>
<sources>
<include name="appMyForm.cs"/>
</sources>
</csc>
</target>
</project>