السلام عليكم
هذا الموضوع استكمال لدورة الاكواد الشاملة
'47- جعل الفورم شفاف عند تحريكه
كود PHP:
Public Class Form1
Private Const WM_NCLBUTTONDOWN As Long = &HA1
Private Const WM_NCLBUTTONUP As Long = &HA0
Private Const WM_MOVING As Long = &H216
Private Const WM_SIZE As Long = &H5
Protected Overrides Sub DefWndProc _
(ByRef m As System.Windows.Forms.Message)
Static LButtonDown As Boolean
If CLng(m.Msg) = WM_NCLBUTTONDOWN Then
LButtonDown = True
ElseIf CLng(m.Msg) = WM_NCLBUTTONUP Then
LButtonDown = False
End If
If LButtonDown Then
If CLng(m.Msg) = WM_MOVING Then
If Me.Opacity <> 0.5 _
Then Me.Opacity = 0.5
ElseIf CLng(m.Msg) = WM_SIZE Then
If Me.Opacity <> 0.5 _
Then Me.Opacity = 0.5
End If
ElseIf Not LButtonDown Then
If Me.Opacity <> 1.0 _
Then Me.Opacity = 1.0
End If
MyBase.DefWndProc(m)
End Sub
End Class
'47- جعل الفورم شفاف عند تحريكه
'48-جعل الفورم ملاصقة لفورم ثاني ثاني عند تحريكه
كود PHP:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Form2.Show()
Form2.Location = New Point _
(Me.Location.X + Me.Width, Me.Location.Y)
End Sub
Private Sub Form1_LocationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LocationChanged
Form2.Location = New Point _
(Me.Location.X + Me.Width, Me.Location.Y)
End Sub
End Class
'48-جعل الفورم ملاصقة لفورم ثاني ثاني عند تحريكه