30-10-14, 10:37 AM
[attachment=5951]
بسم الله الرحمن الرحيم
كيف يمكن الغاء او تجميد زر الاغلاق في البرنامج الخيارات الاخرى موجودة الخاصة بالتصغير او التكبير ماعداء الاغلاق اتمنى المساعدة
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim param As CreateParams = MyBase.CreateParams
param.ClassStyle = param.ClassStyle Or &H200
Return param
End Get
End Property
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
e.Cancel = True
End Sub
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DoClose = True
Application.Exit()
End Sub
Private DoClose As Boolean = False
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If Not DoClose Then e.Cancel = True
End Sub
End Class
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
e.Cancel = True
If (MsgBox("هل تريد إغلاق الرنامج", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "إغلاق") = MsgBoxResult.Yes) Then
End
End If
End Sub