Good evening friends of the forum, I have the following code written in a form windows forms which it works perfectly.
The code does is display in a DataGridView a text file delimited by quotation.
Example:
'09 ' ' Manuel jury ' '1967' '44 years'
'09 ' ' Samuel jimenez ' '1947' '65 years'
Now I want to implement a WPF windows form but not how you start, I see that you also have to implentar xaml.
here the code in windows forms.
Private Sub loadMenuItem_Click(sender As Object, e As EventArgs) Handles loadMenuItem.Click
Try
If (loadMenuItem.Text <> String.Empty) Then
Dim read As New StreamReader("D:\Program Files\text\text.dat")
Dim text As String = ""
Dim count As Integer = 9
Dim split As String() = Nothing
While (Not text Is Nothing)
text = read.ReadLine
If (Not text Is Nothing) Then
split = text.Split(New Char() {CChar("'")}, count)
DataGridView1.Rows.Add(split(1), split(3), split(5), split(7), split(9))
End If
End While
Else
MsgBox("Select the file to load", MsgBoxStyle.Exclamation, "Error")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
I would appreciate if you have something similar or help me pass this code to WPF windows
thanks,
The code does is display in a DataGridView a text file delimited by quotation.
Example:
'09 ' ' Manuel jury ' '1967' '44 years'
'09 ' ' Samuel jimenez ' '1947' '65 years'
Now I want to implement a WPF windows form but not how you start, I see that you also have to implentar xaml.
here the code in windows forms.
Private Sub loadMenuItem_Click(sender As Object, e As EventArgs) Handles loadMenuItem.Click
Try
If (loadMenuItem.Text <> String.Empty) Then
Dim read As New StreamReader("D:\Program Files\text\text.dat")
Dim text As String = ""
Dim count As Integer = 9
Dim split As String() = Nothing
While (Not text Is Nothing)
text = read.ReadLine
If (Not text Is Nothing) Then
split = text.Split(New Char() {CChar("'")}, count)
DataGridView1.Rows.Add(split(1), split(3), split(5), split(7), split(9))
End If
End While
Else
MsgBox("Select the file to load", MsgBoxStyle.Exclamation, "Error")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
I would appreciate if you have something similar or help me pass this code to WPF windows
thanks,