السلام عليكم
هذا الموضوع استكمال لدورة الاكواد الشاملة
'53-تقنية المرآة للفورم بدون ادوات
كود PHP:
Public Class Form1
Const WS_EX_LAYOUTRTL = &H400000
Const WS_EX_NOINHERITLAYOUT = &H100000
Private _mirrored As Boolean = False
Public Property IsMirrored() As Boolean
Get
Return _mirrored
End Get
Set(ByVal Value As Boolean)
If _mirrored <> Value Then
_mirrored = Value
MyBase.OnRightToLeftChanged _
(EventArgs.Empty)
End If
End Set
End Property
Protected Overrides ReadOnly Property _
CreateParams() As System.Windows.Forms.CreateParams
Get
Dim CP As System.Windows.Forms.CreateParams _
= MyBase.CreateParams()
If IsMirrored Then
CP.ExStyle = CP.ExStyle Or _
WS_EX_LAYOUTRTL Or WS_EX_NOINHERITLAYOUT
End If
Return CP
End Get
End Property
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.IsMirrored = True
End Sub
End Class
'53-تقنية المرآة للفورم بدون ادوات
'54- تصوير الفورم
كود PHP:
Public Class Form1
Public Function GetScreenSnapshot _
(ByVal activeWindowOnly As Boolean) As Drawing.Image
My.Computer.Clipboard.Clear()
Dim keys As String = "{PrtSc}"
If (activeWindowOnly) Then
keys = keys.Insert(0, "%")
End If
SendKeys.SendWait(keys)
Return My.Computer.Clipboard.GetImage
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
PictureBox1.Image = GetScreenSnapshot(1)
End Sub
End Class
'54- تصوير الفورم