منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
How to Load txt file into flexgird - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغات البرمجة الاخرى (http://vb4arb.com/vb/forumdisplay.php?fid=4)
+--- قسم : قسم لغة vb6.0 (http://vb4arb.com/vb/forumdisplay.php?fid=18)
+---- قسم : قسم أسئلة vb6.0 (http://vb4arb.com/vb/forumdisplay.php?fid=28)
+---- الموضوع : How to Load txt file into flexgird (/showthread.php?tid=26246)



How to Load txt file into flexgird - ahmad.roz - 26-08-18

عاوز احمل الملف ده داخل flexgrid
ماهو الكود المناسب


RE: How to Load txt file into flexgird - عابر سبيل 2 - 26-08-18

جرب هذا الكود
PHP كود :
Private Sub Command1_Click()
 
   
    Dim txt 
As String
    Open App
.Path "\attachment.txt" For Input As 1
        txt 
StrConv(InputB(LOF(1), 1), vbUnicode)
 
   Close #1
 
       
    Dim arr
() As String
    arr 
Split(txtvbNewLine)
 
   
    With MSFlexGrid1
        
.Rows 1
        Dim t 
As Variant
        For Each t In arr
            
.Rows = .Rows 1
            
.TextMatrix(.Rows 10) = Mid$(t17)
 
           .TextMatrix(.Rows 11) = Mid$(t1021)
 
           .TextMatrix(.Rows 12) = Mid$(t324)
 
           .TextMatrix(.Rows 13) = Mid$(t397)
 
           .TextMatrix(.Rows 14) = Mid$(t482)
 
           .TextMatrix(.Rows 15) = Mid$(t523)
 
       Next
        
.Rows = .Rows 1
    End With
    
End Sub