本文整理汇总了C#中System.Form1.SetSelectButtons方法的典型用法代码示例。如果您正苦于以下问题:C# Form1.SetSelectButtons方法的具体用法?C# Form1.SetSelectButtons怎么用?C# Form1.SetSelectButtons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Form1
的用法示例。
在下文中一共展示了Form1.SetSelectButtons方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MovieItem
public MovieItem(Movie movie, MovieManager manager, Form1 form)
{
this.form = form;
this.movie = movie;
this.Image = movie.image;
this.SizeMode = PictureBoxSizeMode.Zoom;
this.BackColor = Color.Black;
this.MouseDoubleClick += (s, e) =>
{
if (Form.ModifierKeys == Keys.Control)
{
System.Diagnostics.ProcessStartInfo ps = new System.Diagnostics.ProcessStartInfo("cmd", string.Format("/c \"{0}\"", "\"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\" \"" + movie.location + "\""));
System.Diagnostics.Process.Start(ps);
}
else
{
new MoviePlayer(movie).Show();
}
};
sBoxImg.Image = Properties.Resources.selectedImg;
sBoxImg.Size = new System.Drawing.Size(10, 10);
sBoxImg.Location = new Point(190, 0);
sBoxImg.Visible = false;
Controls.Add(sBoxImg);
this.MouseClick += (s, e) =>
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
List<Movie> list = new List<Movie>();
list.Add(movie);
MovieEdit edit = new MovieEdit(manager, list, form, this);
edit.changedImage = false;
edit.newMovie = false;
edit.ShowDialog();
if (edit.changed && edit.changedImage)
{
Image = movie.image;
}
}
else if (e.Button == System.Windows.Forms.MouseButtons.Left && Form.ModifierKeys == Keys.Control)
{
if (selectedMovies.Contains(movie))
{
selectedMovies.Remove(movie);
sBoxImg.Visible = false;
}
else
{
selectedMovies.Add(movie);
sBoxImg.Visible = true;
}
form.SelectedCountLabel.Text = selectedMovies.Count.ToString();
form.SetSelectButtons(selectedMovies.Count != 0);
}
};
this.MouseHover += MovieItem_MouseHover;
this.MouseLeave += MovieItem_MouseLeave;
CustomLabel length = new CustomLabel();
length.Text = (movie.length / 60).ToString() + ":" + (movie.length % 60).ToString("00");
length.Size = new System.Drawing.Size(this.Size.Width, 14);
length.BackColor = Color.Transparent;
length.ForeColor = Color.White;
length.OutlineForeColor = Color.Black;
this.Controls.Add(length);
if (selectedMovies.Contains(movie))
{
sBoxImg.Visible = true;
}
}