I am just trying to migrate from Visual Basic 6.0 to .net. And really new to telerik rad controls for winform. In my form I have added a tab control which will dynamically created tabitems and 3 different contols within each tab. Could someone please help me to find the name of tabitems and control added dynamically. Each time when loop starts functioning I want to check where the new tab item is already added by loop or not.
Private Sub ShowData()
Dim i As Integer
Dim tmpWord As String
Dim tmprelateto As String
Dim itab As Integer
Dim newtab As String
ds = New DataSet()
myAdapter.Fill(ds,
"Dictionary")
mytable = ds.Tables(
"Dictionary")
tmprelateto =
""
tmpWord = ""
i = 0
Do
myrow = mytable.Rows.Item(rownumber)
tmpWord = Trim(myrow.Item(
"Word").ToString)
tmprelateto = Trim(myrow.Item(
"relateto").ToString)
If tmprelateto = "" Then
i = i + 1
If i = 2 Then
Exit Do
End If
RichTextBox1.Text = Trim(myrow.Item(
"DefNep").ToString)
RichTextBox2.Text = Trim(myrow.Item(
"DefEng").ToString)
rownumber = rownumber + 1
Else
newtab = Trim(myrow.Item("pref").ToString)
RadTabStrip1.Items.Add(
New TabItem(newtab))
Dim list As New ListBox
Dim rtfbox As New RichTextBox
Dim rtfbox2 As New RichTextBox
For Each ti As TabItem In RadTabStrip1.Items
ti.ContentPanel.Controls.Add(list)
ti.ContentPanel.Controls.Add(rtfbox)
ti.ContentPanel.Controls.Add(rtfbox2)
With list
.Location =
New Point(5, 3)
.Width = 132
.BorderStyle = BorderStyle.None
.Height = 117
If Trim(myrow.Item("Word").ToString) = "" Then
.Items.Add(Trim(myrow.Item("relateto").ToString))
Else
.Items.Add(Trim(myrow.Item(
"Word").ToString))
End If
End With
With rtfbox
.Location =
New Point(141, 3)
.Width = 133
.Height = 117
.BorderStyle = BorderStyle.None
.Text = Trim(myrow.Item(
"DefNep").ToString)
End With
With rtfbox2
.Location =
New Point(278, 3)
.Width = 132
.Height = 117
.BorderStyle = BorderStyle.None
.Text = Trim(myrow.Item(
"DefEng").ToString)
End With
Next
rownumber = rownumber + 1
End If
Loop
End Sub
Database Used above program looks like:
Word relateto pref DefNep DefNep
------- --------- ------ --------- ---------
A Null Null (ए) अंग्रेजी वर्णमालाको पहिलो अक्षर the first letter of the English alphabet
Null A adj. एउटा, कोही, एक कुनै व्यक्ति one, any, some
Null A prep. जब संज्ञामा उपसर्गको जस्तो यो (when used as a prefix before nouns)