تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] كيف بامكاني تنفيذ مثل هذه الفكرة ؟
#21
السلام عليكم 
هذا هو الحل 
كلاس جديد ثم Run 
كود :
Public Class Class1
   Inherits Control
   Public texts As String() = Nothing
   Private text_ As String = Nothing
   Private point As New Point(0, 0)
   Private tTimer As System.Timers.Timer = Nothing
   Private index As Integer = -1
   Protected Overrides Sub OnPaint(e As PaintEventArgs)
       MyBase.OnPaint(e)
       Dim g As Graphics = e.Graphics
       With g
           .SmoothingMode = Drawing2D.SmoothingMode.HighSpeed
           Me.Font = Font
           Me.ForeColor = ForeColor
           Dim bol As Boolean = point.X < Me.Width
           If texts IsNot Nothing And tTimer IsNot Nothing Then
               If text_ Is Nothing Then

                   'عشوائي
                   'Dim rnd As Random = New Random
                   'text_ = texts(rnd.Next(0, texts.Length))

                   'بترتيب
                   index = If(index >= texts.Length - 1, 0, index + 1)
                   text_ = texts(index)

               End If
               Dim sizeString As New SizeF(.MeasureString(text_, Me.Font))
               If bol Then
                   point.X += 1
                   'السرعة
                   'point.X += 5
               Else
                   point.X = -sizeString.Width
                   text_ = Nothing
               End If
               .DrawString(text_, Me.Font, New SolidBrush(Me.ForeColor), point.X, 0)
           End If
       End With
   End Sub
   Sub New()
       SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or
               ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
       Me.DoubleBuffered = True
       Me.Size = New System.Drawing.Size(200, 50)
       Me.BackColor = Color.Transparent
       Me.Font = Font
       Me.ForeColor = ForeColor
   End Sub
   Public Sub StartTimer()
       index = -1
       tTimer = New System.Timers.Timer
       AddHandler tTimer.Elapsed, AddressOf OnTimedEvent
       tTimer.Interval = 10
       tTimer.AutoReset = True
       tTimer.Enabled = True
   End Sub
   Public Sub StopTimer()
       If tTimer IsNot Nothing Then
           tTimer.Stop()
           tTimer.Enabled = False
           tTimer.Dispose()
           tTimer = Nothing
           Invalidate()
       End If
   End Sub
   Private Sub OnTimedEvent(source As Object, e As Timers.ElapsedEventArgs)
       Invalidate()
   End Sub
End Class
وبعدها أضف الاداة من Toolsbox


كود :
Class11.texts = {"text1", "text2", "text3"}
Class11.StartTimer()
'Class11.StopTimer()

 للامانة الحل ليس من عندي  فقط نقلته لكم
وهذا هو الرابط
https://www.dev-point.com/vb/threads/696536/
اعمل الخير وأجرك لا تنتظره فالله خير من إليك يرده
البرمجة ليست مجرد كود بل هي منهج تفكير منطقي لحل المشكلات







الرد }}}
تم الشكر بواسطة: asemshahen5 , سعود , ميدو الفنان


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  كيفية تنفيذ امر عند التعليم على checkbox بالداتا جريد فيو heem1986 2 162 21-02-24, 01:37 AM
آخر رد: heem1986
  كيفية تنفيذ أمر عرض بيانات من فورم ثان مصمم هاوي 7 338 19-02-24, 12:28 AM
آخر رد: مصمم هاوي
  تنفيذ كود عند حدوث تغيرات فى أحد جداول قاعد بيانات sql heem1986 2 257 16-02-24, 06:37 AM
آخر رد: عبدالله الدوسري
  مشكلة عدم اكتمال تنفيذ بسبب فصل الشبكة او التيار الكهربائي اثناء النتفيذ تناسيم 3 1,846 05-02-24, 10:04 PM
آخر رد: 01AHMED
  مشكلة في تنفيذ البرنامج 'microsoft.ace.oledb.12.0' provider is not registered um_noor20 6 616 13-09-23, 10:05 AM
آخر رد: um_noor20
  تنفيذ اسكربت من خلال فيجوال بيسك atefkhalf2004 4 724 16-03-23, 09:49 PM
آخر رد: atefkhalf2004
  [VB.NET] كيف يمكن تنفيذ امر داخل الباور شل zooz313 2 779 17-12-22, 02:25 PM
آخر رد: kebboud
  [VB.NET] كيفية تنفيذ كود معين كل يوم او يومين ميدو الفنان 6 1,280 10-10-22, 08:18 PM
آخر رد: ميدو الفنان
  تنفيذ الكود عند الضغط على checkbox الموجود في الداتاقريدفيو جيولوجي مبتدئ 1 1,110 29-09-22, 09:55 AM
آخر رد: mohamedassim
  [سؤال] تنفيذ الكود بعد مده زمنيه محدده حسن الجلب 5 1,351 22-08-22, 04:32 AM
آخر رد: سعود

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


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