Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在做 C# 现在我想了解 VB.Net,我想要与此等效的:
Hide(); using (login loginForm = new login()) { var result = loginForm.ShowDialog(); if (result == DialogResult.OK) { Show(); } else { Close(); } }
Hide() Using loginForm As New login() Dim result = loginForm.ShowDialog() If result = DialogResult.OK Then Show() Else Close() End If End Using
你自己尝试了什么?只需在 MSDN 上查找每一件事(Using 语句,If 语句,...)并查看 VB 中的代码示例。
无论如何,这是转换后的代码: