更改子窗体窗口标题 (Visual Basic)

发布于 2024-12-11 16:19:47 字数 57 浏览 0 评论 0原文

谁能告诉我如何将 MDI 结构中子窗体的窗口标题更改为打开的文件的名称?

先感谢您!

Can anyone enlighten me on how to change the window title of a child form in an MDI structure to the name of the file opened?

Thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

简单爱 2024-12-18 16:19:47

正如马可所说,这取决于您的具体情况。但是,此代码(从此处复制) 显示了 VB6 和 VB.Net 中的简单示例:

' Visual Basic 6.0
Dim F(1 To 4) As New Form1
Private Sub MDIForm_Load()
   Dim i As Integer
   Load Form1
   For i = 1 To 4
      F(i).Caption = "Form" & i + 1
      F(i).Show
   Next I
End Sub



' Visual Basic 2005
Private Sub MDIForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  Dim i As Integer = 0
  For i = 0 To 4
      Dim F As New FormChild
      F.Text = "Form " & CStr(i + 1)
      F.Show()
  Next
End Sub

As Marco says, it depends on your exact circumstances. However, this code (as copied from here) shows a simple example in both VB6 and VB.Net:

' Visual Basic 6.0
Dim F(1 To 4) As New Form1
Private Sub MDIForm_Load()
   Dim i As Integer
   Load Form1
   For i = 1 To 4
      F(i).Caption = "Form" & i + 1
      F(i).Show
   Next I
End Sub



' Visual Basic 2005
Private Sub MDIForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  Dim i As Integer = 0
  For i = 0 To 4
      Dim F As New FormChild
      F.Text = "Form " & CStr(i + 1)
      F.Show()
  Next
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文