تقييم الموضوع :
  • 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


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  مشكلة فى Radiobutton عند وضع صورة فيه أبو جودة 3 73 أمس, 04:31 AM
آخر رد: Taha Okla
  [سؤال] أرغب في شريط ضبط الخطوط في أداة RichTextBox والكود كما بالصورة Mostchar 1 127 02-04-24, 01:01 AM
آخر رد: justforit
  تعديل كود ارسال صورة الى الواتس new_programer 2 166 21-03-24, 10:07 PM
آخر رد: new_programer
Rainbow [سؤال] إضافة شريط ضبط الكتابة في أداة RichTextBox أبو خالد الشكري 0 230 29-10-23, 08:19 AM
آخر رد: أبو خالد الشكري
  برمجة اداة BindingNavigator salah525 3 310 29-09-23, 07:14 PM
آخر رد: salah525
  مشكلة مع اداة AdobePDF strongriseman 2 268 10-09-23, 11:46 AM
آخر رد: strongriseman
  اداة WebBrowser onejan1977 1 294 26-08-23, 06:53 PM
آخر رد: Taha Okla
  [سؤال] حد الفورم السفلي كيف نعرف ان اداة معينة وصلته سعود 2 432 22-03-23, 08:08 PM
آخر رد: سعود
  [سؤال] اظهار اداة باكورد على فيجوال بيسك 2008؟ ؟ طالب تقنية المعلومات it 1 494 17-02-23, 10:16 PM
آخر رد: asmarsou
Exclamation ما هذا ؟ مشكلة في اداة ShockwaveFlash لعرض فيديوهات الـ Youtube YousefOkasha 7 2,640 08-02-23, 01:27 AM
آخر رد: abiza

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


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم