31-10-22, 12:56 AM
وعليكم السلام ورحمة الله وبركاته
نفس كود الأخ المميز (asmarsou) الموجود في المشروع مع تعديل بسيط بدون (Timer) و فقط بإستخدام (CheckBox) واحد فقط ..
نفس كود الأخ المميز (asmarsou) الموجود في المشروع مع تعديل بسيط بدون (Timer) و فقط بإستخدام (CheckBox) واحد فقط ..
كود :
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll", SetLastError:=True)> _
Private Shared Function SetWindowPos(ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, _
ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, _
ByVal cy As Integer, ByVal uFlags As UInt32) As Boolean
End Function
ReadOnly HWND_TOPMOST As New IntPtr(-1)
ReadOnly HWND_NoTOPMOST As New IntPtr(-2)
Shared ReadOnly SWP_NOSIZE As UInt32 = Convert.ToUInt32(&H1)
Shared ReadOnly SWP_NOMOVE As UInt32 = Convert.ToUInt32(&H2)
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
SetWindowPos(Me.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
Else
SetWindowPos(Me.Handle, HWND_NoTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End If
End Sub
End Classقال صلى الله عليه وسلم:
«كلمتان خفيفتان على اللسان
ثقيلتان في الميزان،حبيبتان إلى الرحمن:
سبحان الله وبحمده، سبحان الله العظيم».
