24-02-23, 01:05 AM
(23-02-23, 11:17 PM)عبدالكريم برشدان كتب : اريد تصنيف وترتيب الاسماء
مثل الصورة
هذا الكود :
كود :
dp.Fill(ds)
dt = ds.Tables.Item(0)
num2 = (dt.Rows.Count - 1)
Me.FlowLayoutPanel1.Controls.Clear()
Dim str1 As String = ""
Dim FirstChar As String = "", Fi1 As String = ""
Do While (i <= num2)
str1 = dt.Rows.Item(i).Item("nam").ToString
FirstChar = Mid(str1, 1, 1)
If (i = 0) Or (FirstChar <> Fi1) Then
Dim uc1 As New UserControl1
uc1.Label1.Text = FirstChar
uc1.Label1.Left = uc1.Width - uc1.Label1.Width - 20
Me.FlowLayoutPanel1.Controls.Add(uc1)
uc1.Label1.Font = New Font(uc1.Label1.Font.Name, uc1.Label1.Font.Size + 2, FontStyle.Bold)
uc1.Label1.ForeColor = Color.WhiteSmoke
uc1.BackColor = Color.LightGray
uc1.Height = uc1.Height * 2 / 3
uc1.Label1.Top = (uc1.Height - uc1.Label1.Height) / 2
Fi1 = FirstChar
End If
Dim uc As New UserControl1
uc.Label1.Text = dt.Rows.Item(i).Item("nam").ToString
' uc.Label1.RightToLeft = RightToLeft
uc.Label1.Left = uc.Width - uc.Label1.Width - 30
Me.FlowLayoutPanel1.Controls.Add(uc)
i += 1
If i = j Then Exit Do
Loop
Button2.Enabled = True
Button3.Enabled = Trueعلى كذا بيطلعلي عندك نسخة من البرنامج بعد الانتهاء منه ..
قال صلى الله عليه وسلم:
«كلمتان خفيفتان على اللسان
ثقيلتان في الميزان،حبيبتان إلى الرحمن:
سبحان الله وبحمده، سبحان الله العظيم».
