VB 간이 메모장 구현 코드

1726 단어 수첩
이벤트 구현 코드:
 
Private Sub mQuit_Click()
Text1.Text = ""
End
End Sub

Private Sub mNew_Click()
Text1.Text = ""
Form1.Caption = " "
End Sub
Private Sub mopen_Click()
CommonDialog1.ShowOpen
Frame = CommonDialog1.FileName
If fname <> "" Then
Form1.Caption = fname
Text1.Text = ""
Open fname For Input As #1
b = ""
Do Until EOF(1)
Line Input #1, nextline
b = b & nextline & Chr(13) & Chr(10)
Loop
Close #1
Text1.Text = b
End If
End Sub
Private Sub mSave_Click()
If Form1.Caption = " " Or Form1.Caption = "" Then
CommonDialog1.ShowSave
fname = CommonDialog1.FileName
Else
fname = Form1.Caption
End If
If fname <> "" Then
Form1.Caption = fname
Open fname For Output As #1
Print #1, Text1.Text
Close #1
End If
End Sub
Private Sub mNewSave_Click()
CommonDialog1.ShowSave
If fname <> "" Then
Form1.Caption = fname
Open fname For Output As #1
Print #1, Text1.Text
Close #1
End If
End Sub
CommonDialog 컨트롤이 필요합니다!속성 코드:
 
Begin VB.Menu mFile
Caption = " "
Begin VB.Menu mNew
Caption = " "
End
Begin VB.Menu mOpen
Caption = " "
End
Begin VB.Menu mSave
Caption = " "
End
Begin VB.Menu mNewSave
Caption = " "
End
Begin VB.Menu mQuit
Caption = " "
Shortcut = ^E
End
End

좋은 웹페이지 즐겨찾기