求VB.NET记事本“保存”按钮代码
1个回答
展开全部
Dim WithEvents SvaeFileDialog1 As New SaveFileDialog
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles button1.Click
Dim pp As String
SvaeFileDialog1.Filter = "文档文件(*.txt)|*.txt|所有文件(*.*)|*.*"
Dim r As MsgBoxResult
r = SvaeFileDialog1.ShowDialog
If r Then
FileOpen(1, SvaeFileDialog1.FileName, OpenMode.Output)
pp = Mid(Me.TextBox1.Text, 1, Len(Me.TextBox1.Text))
Print(1, pp)
Close()
MsgBox("Export Successfully!")
End If
End Sub
以上VS2010 WPF程序。
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles button1.Click
Dim pp As String
SvaeFileDialog1.Filter = "文档文件(*.txt)|*.txt|所有文件(*.*)|*.*"
Dim r As MsgBoxResult
r = SvaeFileDialog1.ShowDialog
If r Then
FileOpen(1, SvaeFileDialog1.FileName, OpenMode.Output)
pp = Mid(Me.TextBox1.Text, 1, Len(Me.TextBox1.Text))
Print(1, pp)
Close()
MsgBox("Export Successfully!")
End If
End Sub
以上VS2010 WPF程序。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询