範例:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace CancelAltAndF4 { public partial class Frm_Main : Form { public Frm_Main() { InitializeComponent(); } private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Alt && e.KeyValue == 115)//如果按下的Alt和F4 e.Handled = true;//不執行操作 } } }
沒有留言:
張貼留言