تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
اريد الحصول على كل الصور التى فى الريسورس ثم عمل تكرار لعرضها فى بكتشر بوكس
#11
تفضل اخى هذا الكود البسيط لكن يجب ان يكون

ملحوظة يجب ان يكون ال build action ف جميع الملفات الرسورس بقيمة Embedded Resource

كود :
Imports System.Reflection
Imports System.Reflection.Assembly
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim trd As New System.Threading.Thread(AddressOf load)
        trd.Start()
    End Sub
    Private Sub load()
        For Each file As String In GetExecutingAssembly.GetManifestResourceNames
            file = Replace(file, My.Application.Info.AssemblyName & ".", "_")
            Dim str() As String
            str = file.Split(".")
            Dim fg As String
            fg = str(0)
            System.Threading.Thread.Sleep(4000)
            PictureBox1.Image = CType(My.Resources.ResourceManager.GetObject(fg), Image)
        Next
    End Sub
End Class
الرد }}}
تم الشكر بواسطة:
#12
تفضل اخى هذا الكود البسيط لكن يجب ان يكون

ملحوظة يجب ان يكون ال build action ف جميع الملفات الرسورس بقيمة Embedded Resource

كود :
Imports System.Reflection
Imports System.Reflection.Assembly
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim trd As New System.Threading.Thread(AddressOf load)
        trd.Start()
    End Sub
    Private Sub load()
        For Each file As String In GetExecutingAssembly.GetManifestResourceNames
            file = Replace(file, My.Application.Info.AssemblyName & ".", "_")
            Dim res As Boolean = True
            If file.Contains(".gif") Then
            ElseIf file.Contains(".bmp") Then
            ElseIf file.Contains(".jpg") Then
            ElseIf file.Contains(".jpeg") Then
            ElseIf file.Contains(".png") Then
            Else
                res = False
            End If
            If res = True Then
                Dim str() As String
                str = file.Split(".")
                Dim fg As String
                fg = str(0)
                System.Threading.Thread.Sleep(4000)
                PictureBox1.Image = CType(My.Resources.ResourceManager.GetObject(fg), Image)
            End If
          
        Next
    End Sub
End Class
الرد }}}
تم الشكر بواسطة:



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


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