تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[سؤال] جعل خلفية اداة RichTextBox صورة
#1
Information 
شباب اريد جعل  اداة RichTextBox صورة
ضرورى
المطلوب بالتفصيل ان يكون لدي اداة RichTextBox  خلفية بمعنى ان يكون ظاهر خلف النص صورة 
Huh Huh Huh Huh
الرد }}}
تم الشكر بواسطة:
#2
جرب اضافة كلاس
كود :
Public Class OpaqueRichTextBox
   Inherits RichTextBox

   Private Shared ReadOnly DefaultBackground As Color = Color.Transparent
   Private TransparentImage As Image

   Public Sub New()
       Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
       Me.SetStyle(ControlStyles.Opaque, True)
       Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
       BackColor = DefaultBackground
   End Sub

   Public Overrides Property BackColor() As System.Drawing.Color
       Get
           Return MyBase.BackColor
       End Get
       Set(ByVal value As System.Drawing.Color)
           MyBase.BackColor = value
       End Set
   End Property

   Public Property Image() As Image
       Get
           Return TransparentImage
       End Get
       Set(ByVal value As Image)
           TransparentImage = value
           Invalidate()
       End Set
   End Property

   Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
       Get
           Dim cp As CreateParams = MyBase.CreateParams
           cp.ExStyle = cp.ExStyle Or &H20
           Return cp
       End Get
   End Property

   ' Infrastructure to cause the default background to be transparent
   Public Function ShouldSerializeBackColor() As Boolean
       Return BackColor = DefaultBackground
   End Function

   ' Infrastructure to cause the default background to be transparent
   Public Sub ResetBackground()
       BackColor = DefaultBackground
   End Sub

End Class


ووضع الصورة خلف التيكست
الرد }}}
تم الشكر بواسطة: سعود
#3
(28-10-15, 11:23 PM)HASAN6.0 كتب : جرب اضافة كلاس
كود :
Public Class OpaqueRichTextBox
   Inherits RichTextBox

   Private Shared ReadOnly DefaultBackground As Color = Color.Transparent
   Private TransparentImage As Image

   Public Sub New()
       Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
       Me.SetStyle(ControlStyles.Opaque, True)
       Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
       BackColor = DefaultBackground
   End Sub

   Public Overrides Property BackColor() As System.Drawing.Color
       Get
           Return MyBase.BackColor
       End Get
       Set(ByVal value As System.Drawing.Color)
           MyBase.BackColor = value
       End Set
   End Property

   Public Property Image() As Image
       Get
           Return TransparentImage
       End Get
       Set(ByVal value As Image)
           TransparentImage = value
           Invalidate()
       End Set
   End Property

   Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
       Get
           Dim cp As CreateParams = MyBase.CreateParams
           cp.ExStyle = cp.ExStyle Or &H20
           Return cp
       End Get
   End Property

   ' Infrastructure to cause the default background to be transparent
   Public Function ShouldSerializeBackColor() As Boolean
       Return BackColor = DefaultBackground
   End Function

   ' Infrastructure to cause the default background to be transparent
   Public Sub ResetBackground()
       BackColor = DefaultBackground
   End Sub

End Class


ووضع الصورة خلف التيكست

شكرا اخى
ولكن الكود به مشكلة  Sad
الرد }}}
تم الشكر بواسطة:
#4
أنصحك أن لا تستخدم هذا الاسلوب خاصة أن التغيير في مثل هذه الانواع من الكونترول باستخدام الجرافكس له مشاكل لا حصر لها و هذا ما جعل مايكروسوفت تصمم الكونترول بمثل هذه الطريقة أصلا
الرد }}}
تم الشكر بواسطة: سعود , mina250


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] طريقة توسيط النص داخل اداة comboBox سمير1404 7 3,858 24-08-25, 01:01 PM
آخر رد: أبو خالد الشكري
  [VB.NET] استفسار بخصوص البحث في RichTextBox SerialPort dubai.eig 2 661 18-06-25, 11:09 AM
آخر رد: dubai.eig
  مشكلة التاريخ اداة DateTimePicker Wolfalwolf20 2 485 06-01-25, 06:14 PM
آخر رد: aljzazy
  إدراج صورة الموظف من خلال رابط في حقل من قاعدة البيانات saud1004 4 532 13-12-24, 04:48 AM
آخر رد: saud1004
Exclamation [VB.NET] ممكن عمل كود لحفظ المكتوب داخل اداة TextBox الورد الصناعي 9 797 17-10-24, 11:43 PM
آخر رد: salamandal
Lightbulb [سؤال] تحويل صورة الى ملف Pdf ackore 8 762 27-09-24, 07:51 PM
آخر رد: محمد مسافر
  اضافة صورة مخزنة في قاعدة البيانات sql الى الكريستال ريبورت صالح عبدالله 3 461 24-09-24, 09:52 AM
آخر رد: صالح عبدالله
  [كود] كود عند اختيار صورة في فورم تسمع في فورم اخري Mostafa201255411 0 245 13-09-24, 09:20 PM
آخر رد: Mostafa201255411
  التعامل مع موقع ويب لجلب صورة لالفيجوال بيزك صبري زينوبي 3 443 09-09-24, 11:22 PM
آخر رد: Taha Okla
  ماهي طريقة تحويل ملف pdf الى صورة جيولوجي مبتدئ 3 559 12-07-24, 09:22 PM
آخر رد: atefkhalf2004

التنقل السريع :


يقوم بقرائة الموضوع: