重新打开vb编的程序时怎样使窗口保持上次退出时的位置和形状?
展开全部
Private Sub Form_Load() On Error GoTo FileError Dim l As Integer Dim t As Integer Dim w As Integer Dim h As Integer If Right(App.Path, 1) = "\" Then Open App.Path & "setting.txt" For Input As #1 Else Open App.Path & "\setting.txt" For Input As #1 End If Input #1, l, t, w, h Close #1 Me.Move l, t, w, h FileError: End Sub Private Sub Form_Unload(Cancel As Integer) On Error GoTo FileError If Right(App.Path, 1) = "\" Then Open App.Path & "setting.txt" For Output As #1 Else Open App.Path & "\setting.txt" For Output As #1 End If Write #1, Me.Left, Me.Top, Me.Width, Me.Height Close #1 FileError: End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询