How to disable shortcuts ALT+F4, ALT+Esc, or Windows Button in visual basic form
ID: 2246353 • Letter: H
Question
How to disable shortcuts ALT+F4, ALT+Esc, or Windows Button in visual basic form and see the below picture what code is error?
Public Class frm Kiosk E Private Sub RichTextBox1_TextChanged(sender As Object, e As EventArgs) Handles RichTextBox1.TextChanged End Sub : Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click wbWebBrowser.Navigate("http://www.wou.edu.my/school-of-business-administration/") End Sub Private Sub frmKiosk_ Load (sender As Object, e As EventArgs) Handles MyBase. Load Me.StartPosition = FormstartPosition . Manual Me. Location = My . Computer, Screen . WorkingArea. Location Me.Size My. Computer.Screen.WorkingArea.Size Me.FormBorderStyle -FormBorderStyle.None Me·ShowInTaskbar = False Dim Cance! As Boolean = EventArgs.cancel Dim UnloadMode As System.Windows. Forms .closeReason = EventArgs.closeReason 'Prevent it closing Cancel = True End If Allow it to close if it wasn't the user's action EventArgs.Cancel- Cancel End SubExplanation / Answer
Error in code because cancel is not a member of "System.EventArgs. Cancel is not a member of System.EventArgs. It’s a member of CancelEventArgs.
Similarly closeReason is also not a member of EventArgs it is member of FormClosingEventArgs
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.