
前田稔(Maeda Minoru)の超初心者のプログラム入門
![]()
![]()
| ファイル(&F) | メソッド | 表示(&V) | メソッド | ヘルプ(&H) | メソッド | ||
|---|---|---|---|---|---|---|---|
| 日付でコピー(&C) | Copy | デスクトップ(&T) | Desktop | バージョン情報(&A) | HelpAbout | ||
| ゴミ箱(&G) | DustBox | マイドキュメント(&M) | MyDoc | ||||
| 削除(&D) | Delete | マイピクチャ(&P) | MyPic | ||||
| 上書コピー(&Z) | Zcopy | 大アイコン(&L) | Large | ||||
| 終了(&X) | FileExit | 小アイコン(&S) | Small | ||||
| 詳細(&D) | Details |
private void FileExit(object sender, EventArgs e)
{
this.Close();
}
private void HelpAbout(object sender, EventArgs e)
{
MessageBox.Show("File Handler Ver 1.0 by Maeda Minoru");
}
|
![]()


![]()
this.listView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDown);
// マウスが右クリックされたとき
private void listView1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button==System.Windows.Forms.MouseButtons.Right)
{ contextMenuStrip1.Show(this, new Point(e.X, e.Y));
}
}
|
// 選択アイテムを記録
private void ItemSave(object sender, EventArgs e)
{
if (Clip_Set()==false) MessageBox.Show("アイテムを選択して下さい");
}
|
// 選択アイテムをクリップボードに記録
private bool Clip_Set()
{
if (listView1.SelectedItems.Count==0) return false;
System.Collections.Specialized.StringCollection files =
new System.Collections.Specialized.StringCollection();
for(int i=0; i<listView1.SelectedItems.Count; i++)
files.Add(Sel_Dir + "\\" + listView1.SelectedItems[i].Text);
Clipboard.SetFileDropList(files);
return true;
}
|
class form01
{
[STAThread]
public static void Main()
・・・
|
![]()