⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 这里有很多很实用的VB编程案例,方便大家学习VB.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "让文本框的输入具备覆盖的功能"
   ClientHeight    =   2130
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2130
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   615
      Left            =   840
      TabIndex        =   0
      Text            =   "http://zmhh.mycool.net"
      Top             =   600
      Width           =   2895
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii <> vbKeyBack And KeyAscii <> vbKeyReturn Then
         '将 Text1 输入光标位置的字符变成“被选取的字符”。
        Text1.SelLength = 1
        '“被选取的字符”取代成为“输入的字符”。
        Text1.SelText = Chr(KeyAscii)
        '将此一字符屏蔽,不再传给 TextBox。
        KeyAscii = 0
        End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -