17-04-14, 03:56 AM
قمت بتجربة هذا الكود وقد نجح باضافة الفلاشة عند وصلها بالحاسب في حالة واحدة وهي ان نضع الفلاشة ونصغر الفورم ونعيد تكبيرها فيضاف اسمها الى القائمة
اذا ممكن تعديل عليه حتى يضيف الفلاشة بدون تصغير الفورم.
Imports System.IO
Public Class Form1
Dim a As DriveInfo
Private Sub ComboBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.GotFocus
ComboBox1.Items.Clear()
For Each a As DriveInfo In My.Computer.FileSystem.Drives
If a.IsReady Then
ComboBox1.Items.Add(a.Name)
ComboBox1.Update()
ComboBox1.Refresh()
End If
Next
End Sub
اذا ممكن تعديل عليه حتى يضيف الفلاشة بدون تصغير الفورم.
Imports System.IO
Public Class Form1
Dim a As DriveInfo
Private Sub ComboBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.GotFocus
ComboBox1.Items.Clear()
For Each a As DriveInfo In My.Computer.FileSystem.Drives
If a.IsReady Then
ComboBox1.Items.Add(a.Name)
ComboBox1.Update()
ComboBox1.Refresh()
End If
Next
End Sub

