(12-09-19, 01:38 AM)SnTnt كتب :(12-09-19, 01:36 AM)asemshahen5 كتب : إذا كنت تقصد تعبئة الكومبوبوكس بالبلدان فهذا بسيط :
PHP كود :
Imports System.Collections.Generic
Imports System.Globalization
Public Class Form1
Dim countryList As SortedDictionary(Of String, String)
Public Sub ListCountries(SourceCombo As System.Windows.Forms.ComboBox)
If countryList Is Nothing Then
countryList = BuildCountryList()
End If
SourceCombo.DisplayMember = "Key"
SourceCombo.ValueMember = "Value"
SourceCombo.DataSource = New BindingSource(countryList, Nothing)
' No need to sort anything '
End Sub
Public Function BuildCountryList() As SortedDictionary(Of String, String)
Dim temp = New SortedDictionary(Of String, String)
For Each ci As CultureInfo In CultureInfo.GetCultures(CultureTypes.AllCultures)
Dim ri As RegionInfo
Try
ri = New RegionInfo(ci.Name)
Catch
'If a RegionInfo object could not be created don't use the CultureInfo for the country list.'
Continue For
End Try
' If the country is not already in the countryList add it...'
If Not temp.ContainsKey(ri.EnglishName) Then
temp.Add(ri.EnglishName, ri.ThreeLetterISORegionName)
End If
Next
Return temp
End Function
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
ListCountries(ComboBox1)
End Sub
End Class
البلدان الذي في الكومبو بوكس الخاص في الموقعاقصد مثل الكومبو بوكس في الموقع
مثل هاذا !!
عندما اقوم بكتابة الكود الذي في الصورة يظهر خطأ عند For Each child As HtmlElement In OptioList.All
![]()
بعد اذن الاستاذ عاصم.
انتظر أخى بصطب الفيجوال بيسك 2017 وبما انى اول مرة اصطبه مجننى من ساعتين
أنتهى منه واعملك مثال لجلب ما بداخل الكمبوبوكس تبع الموقع لبرنامجك بأمر الله.
اتفضل أخى
كود :
For Each elem As HtmlElement In WebBrowser1.Document.GetElementsByTagName("td")
If (elem.GetAttribute("colspan") = "2") Then
For Each element As HtmlElement In elem.GetElementsByTagName("select")
For Each element2 As HtmlElement In element.GetElementsByTagName("option")
ComboBox1.Items.Add(element2.InnerText)
Next
Next
End If
Next


