掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
textboxに””を入れる場合。。。。 (ID:111370)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
その使い方なら Line Input でいいんでないかなぁ。 form1、comannd1、command2、大きめのtext1、text2を作る。 text1、text2にmultilineをTrue、ScrollBarsを 3 にでもしておく。 ↓これをはる Option Explicit Private Const strTestFilename = "c:\test.txt" Private Sub Command1_Click() Dim intFileNum As Integer intFileNum = FreeFile Open strTestFilename For Output As #intFileNum Print #intFileNum, Text1.Text Close #intFileNum MsgBox "かきこみおわり" End Sub Private Sub Command2_Click() Dim intFileNum As Integer, strBuf As String Text2.Text = "" If Len(Dir$(strTestFilename)) Then intFileNum = FreeFile Open strTestFilename For Input As #intFileNum Do While (Not EOF(intFileNum)) Line Input #intFileNum, strBuf Text2.Text = Text2.Text & strBuf & vbCrLf Loop Close #intFileNum MsgBox "よみこみおわり" Else MsgBox "Command1 を押してケロ" End If End Sub Private Sub Form_Load() Text1.Text = "" Text2.Text = "" End Sub >Write #1, a,b,c,d,e,f,g VB5以前ではアウツですが、Split関数というのがあります。(詳しくはヘルプなどで) 一旦くっつけてまとめて1行で読み書きし、後でバラすというのもアリかもしれません。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.