标题:【求助】format格式化出现了“错误的参数号或无效的属性赋值”,怎么办,哪 ...
只看楼主
YinruoH
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2015-6-11
结帖率:0
已结贴  问题点数:20 回复次数:2 
【求助】format格式化出现了“错误的参数号或无效的属性赋值”,怎么办,哪里出问题了?
Dim str$, X%
Private Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, _
  ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal y As Long, _
  ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)                         '此段为通用声明


Private Sub cls_Click()                                                   '清空文本框
  a = MsgBox("你确定要清空?", vbYesNo, "提示")
  If a = 6 Then Text1.Text = ""
End Sub

Private Sub Form_Load()
  SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3                               '将以上两段代码加入程序即可使程序始终保持在最上端
  str = format(Now, "yy-mm-dd hh")
 'Open "C:\Users\Administrator\Desktop\1.txt" For Output As #1     在桌面新建文件
  Open App.Path & "\" & "音若记事本" & str & ".txt" For Output As #1                   '在程序所在文件夹新建
End Sub
                                               

Private Sub Form_Resize()                 '使文本框大小与窗体大小一致
  Text1.Width = Me.Width
  Text1.Height = Me.Height
End Sub

Private Sub Form_Unload(Cancel As Integer) '关闭程序时保存
  Print #1, Text1.Text
  Close #1
End Sub

Private Sub saveas_Click()                   '另存为
  str = format(Now, "yy-mm-dd hh") & "副 本"
  Open App.Path & "\" & "音若记事本" & str & ".txt" For Output As #2
  Print #2, Text1.Text
  Close #2
End Sub
搜索更多相关主题的帖子: 通用 文本框 
2015-06-11 15:29
lianyicq
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:26
帖 子:735
专家分:3478
注 册:2013-1-26
得分:20 
form_load过程运行了,没出问题

大开眼界
2015-06-11 15:37
YinruoH
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2015-6-11
得分:0 
我知道什么原因了,看这里!http://group.
2015-06-11 17:12



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-446481-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.577059 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved