📄 frmkeepitup.vb
字号:
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows.Forms
Imports System.Threading
Namespace CodeForChapter11cs
' Only run this from within the IDE with F5
Public Partial Class frmKeepItUp
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
' start thread that will block
Private Sub menuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles menuItem1.Click
Dim t As Thread = New Thread(AddressOf Me.KeepTheProcessUp)
't.IsBackground = True
t.Start()
MessageBox.Show("Hit the Exit button. Is VS still debugging")
End Sub
Private Sub KeepTheProcessUp()
Dim mre As ManualResetEvent = New ManualResetEvent(False)
mre.WaitOne()
MessageBox.Show("Never shown!")
' imagine more code
End Sub
'Exit
Private Sub menuItem2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles menuItem2.Click
Me.Close()
Application.Exit() ' utterly superfluous but just to emphasize the point!
End Sub
End Class
End Namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -