Tags-Etiketler
Bu kısımda sitemizde etiketlenmiş makaleleri toplu olarak bulabilirsiniz...
[ kapat ] /
Makaleler-Article(s)
kapat ile ilgili toplam 2 makale bulundu ! (A total of 2 article(s) about kapat was(were) found in all of articles!)
Article |
---|
Formun Kapat Tuşunu Etkisiz Hale Getirmek Forma ait üst menüdeki kapat tuşunu etkisiz hale getireceğiz. Bunun için GetSystemMenu, EnableMenuItem library dosyalarından yararlanacağız. Aşağıdaki Şekil 1 i inceleyin.
Public Class Form1
Public Class CloseButton
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Integer, ByVal revert As Integer) As Integer
Private Declare Function EnableMenuItem Lib "user32" (ByVal menu As Integer, ByVal ideEnableItem As Integer, ByVal enable As Integer) As Integer
Private Const SC_CLOSE As Integer = &HF060
Private Const MF_BYCOMMAND As Integer = &H0
Private Const MF_GRAYED As Integer = &H1
Private Const MF_ENABLED As Integer = &H0
Public Shared Sub Disable(ByVal form As System.Windows.Forms.Form) | Kapatma Tuşunu Etkisiz Hale Getirme Formun; üst menüsündeki kapatma tuşunu etkisiz hale getireceğiz. Aşağıdaki şekli inceleyin.
Public Class Form1
Public Class CloseButton
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Integer, ByVal revert As Integer) As Integer
Private Declare Function EnableMenuItem Lib "user32" (ByVal menu As Integer, ByVal ideEnableItem As Integer, ByVal enable As Integer) As Integer
Private Const SC_CLOSE As Integer = &HF060
Private Const MF_BYCOMMAND As Integer = &H0
Private Const MF_GRAYED As Integer = &H1
Private Const MF_ENABLED As Integer = &H0
Public Shared Sub Disable(ByVal form As System.Windows.Forms.Form)
Select Case EnableMenuItem(GetSystemMenu(form.Handle.ToInt32, 0), SC_CLOSE, MF_BYCOMMAND Or MF_GRAYED)
Case MF_ENABLED
Case MF_GRAYED
Case &HFFFFFFFF
Throw New Exception("Kapatma menüsü bulunamıyor")
Case Else
End Select
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CloseButton.Disable(Me)
End Sub
Private Sub Form1_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
CloseButton.Disable(Me)
End Sub
End Class
Bir sonraki makalede görüşmek üzere. Bahadır |
|
        Sitede yayınlanan makaleleri
Blog sitemizden de takip edebilirsiniz.
Sitemizdeki makaleleri RSS olarak takip edebilirsiniz.