📄 frmbasewithsip.vb
字号:
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows.Forms
Imports System.ComponentModel
Namespace CodeForChapter2
Public Partial Class frmBaseWithSIP
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
' Add a TextBox to the Form and add the two event handlers
' Add an InputPanel control to the Form
Private Sub textBox1_GotFocus(ByVal sender As Object, ByVal e As EventArgs) Handles textBox1.GotFocus
inputPanel1.Enabled = True
End Sub
Private Sub textBox1_LostFocus(ByVal sender As Object, ByVal e As EventArgs) Handles textBox1.LostFocus
inputPanel1.Enabled = False
End Sub
Private Sub inputPanel1_EnabledChanged(ByVal sender As Object, ByVal e As EventArgs) Handles inputPanel1.EnabledChanged
If inputPanel1.Enabled Then
textBox2.Top -= inputPanel1.Bounds.Height
Else
textBox2.Top += inputPanel1.Bounds.Height
End If
End Sub
Private Sub frmBaseWithSIP_Closing(ByVal sender As Object, ByVal e As CancelEventArgs) Handles MyBase.Closing
' must do this to make sure the inputpanel releases
' its reference to this form
RemoveHandler inputPanel1.EnabledChanged, AddressOf inputPanel1_EnabledChanged
End Sub
End Class
End Namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -