向VB高手求救!!!!!!!!!!!!!!!!!!!!!!!!!!!

来源:百度知道 编辑:UC知道 时间:2024/05/09 15:39:39
'声明查找变量

Dim sFind As String

'声明文件类型

Dim FileType, FiType As String

'初始化程序

Private Sub Form_Load()

'设置程序启动时的大小

Me.border='1' Height = 6000

Me.Width = 9000

End Sub

'设置编辑框的位置和大小

Private Sub Form_Resize()

On Error Resume Next '出错处理

RichTextBox1.Top=20

RichTextBox1.center=20

RichTextBox1.border='1' Height = Scaleborder='1' Height-40

RichTextBox1.Width = ScaleWidth-40

End Sub

'新建文件

Private Sub mnuNew_Click()

RichTextBox1.Text = "" '清空文本框

FileName = "未命名"

Me.Caption = FileName

End Sub

'打开文件

Private Sub mnuOpen_Click()

CommonDialog1.Filter="文本文档(*.txt) *.txt RTF文档(*.rtf) *.rt

Private Sub Form_Load()

'设置程序启动时的大小

Me.border='1' Height = 6000

Me.Width = 9000

End Sub

Private Sub Form_Resize()

On Error Resume Next '出错处理

RichTextBox1.Top = 20

RichTextBox1.center = 20

RichTextBox1.border='1' Height = Scaleborder='1' Height-40

RichTextBox1.Width = ScaleWidth - 40

End Sub

上面有错
改为
Private Sub Form_Load()

'设置程序启动时的大小

Me.BorderStyle = 1
Me.Height = 6000

Me.Width = 9000

End Sub

'设置编辑框的位置和大小

Private Sub Form_Resize()

On Error Resume Next '出错处理

RichTextBox1.Top = 20

RichTextBox1.Left = 20

'RichTextBox1.bordersytle = 1

RichTextBox1.Width = ScaleWidth - 40
RichTextBox1.Height = ScaleHeight - 40

End Sub

还有代码中涉及到其他一些控件 需要你自己添加

<