23-07-13, 12:14 AM
السلام عليكم ورحمة الله وبركاته
نفس الكود السابق تعديل بسيط ليظهر النص في منتصف الشاشة :
ملحوظة : النص سيختفي من الشاشة بمجرد عمل تحديث للشاشة (F5) ، أو في حالة أغلقت البرنامج سيتم مسح النص أيضاً .
****
***
**
*
نفس الكود السابق تعديل بسيط ليظهر النص في منتصف الشاشة :
كود :
Imports System.Drawing.Drawing2D
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("User32.dll")> _
Private Shared Function GetDC(ByVal hwnd As IntPtr) As IntPtr
End Function
<DllImport("User32.dll")> _
Private Shared Sub ReleaseDC(ByVal dc As IntPtr)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim desktop As IntPtr = GetDC(IntPtr.Zero)
Using g As Graphics = Graphics.FromHdc(desktop)
Dim SL As Drawing.Rectangle = Screen.PrimaryScreen.WorkingArea
g.DrawString("اللهم صلي علي محمد وعلي آل محمد", New Font("Arial", 20, FontStyle.Bold), Brushes.White, SL.Width / 2 - 100, SL.Height / 2)
End Using
ReleaseDC(desktop)
End Sub
End Classملحوظة : النص سيختفي من الشاشة بمجرد عمل تحديث للشاشة (F5) ، أو في حالة أغلقت البرنامج سيتم مسح النص أيضاً .
****
***
**
*

