VB.NET Form Çıkışını Engelleme

D

Drenated

Legend Member
Joined
Nov 23, 2019
Messages
1,865
Reaction score
1,517
Bu kodu projenize eklediğinizde formun "x" butonu işe yaramaz hale gelecektir.
Ek olarak programınızı görev yöneticisinde gizleyerek kodu daha değerli bir hale getirebilirsiniz.


Code:
Private Sub frmMyform_FormClosing(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Dim Cancel As Boolean = eventArgs.Cancel
Dim UnloadMode As System.Windows.Forms.CloseReason = eventArgs.CloseReason
If UnloadMode = CloseReason.UserClosing Then
'Prevent it closing
Cancel = True
End If


eventArgs.Cancel = Cancel
End Sub
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Tema düzenleyici

Top Bottom