功能我試圖創建下面的代碼的功能,在的WinForms。 你看到的是一個名爲ytplayerSearch的函數,而不是ytplayer。 目前的代碼工作,但我一直在努力使它更乾淨。創造的功能
private void btPlayMin_Click(object sender, EventArgs e)
{
ytplayer.playLink(sender, e, link);
ytplayer.miniMax("Normal", new Size(300, 24), new Size(400, 95), false, "", FormBorderStyle.FixedToolWindow, true);
ytplayer.TopMost = true;
ytplayer.BringToFront();
ytplayer.TopMost = false;
int x = Screen.PrimaryScreen.WorkingArea.Width - 375;
ytplayer.Location = new Point(x, 0);
ytplayer.Show();
this.Close();
}
private void btPlayNorm_Click(object sender, EventArgs e)
{
ytplayer.playLink(sender, e, link);
ytplayer.miniMax("Minimal", new Size(300, 240), new Size(400,335), true, "YoutubePlayer", FormBorderStyle.FixedSingle, false);
ytplayer.TopMost = true;
ytplayer.BringToFront();
ytplayer.TopMost = false;
ytplayer.Show();
this.Close();
}
問題是我不太清楚如何發送函數到另一個函數。較低的代碼可能會讓我的問題更加清晰。
private void settingsYTP(.....problem.....)
{
}
移動到參數所有不同的設置 – Grundy