vb.net - 在多行文本框中具有选择或焦点的多个文本框?
问题描述
我有一个多行文本框文本框的问题,在搜索字符串时,它首先关注第一个位置的单词,但仍然通过不选择它们来继续选择其他单词 not !
这是我的代码:
If testArray(p) / 2987 >= dub + (1787 / 2987) And testArray(p) / 2987 < dub + 1 Then
Main.TextBox31.Focus()
Main.TextBox31.SelectionStart = Main.TextBox31.Text.IndexOf(Me.TextBox1.Text)
Main.TextBox31.SelectionLength = Me.TextBox1.TextLength
Main.TextBox31.ScrollToCaret()
MsgBox("oui16")
System.Threading.Thread.Sleep(1000)
End If
第一行给了我搜索字节的位置。TextBox31 控件是多行控件,其中我有 testArray (p) 数组中的搜索字节。TextBox1 控件为我提供了我正在寻找的字符串。
PS:
解决方案
我能够用列表框实现这样的目标,它也可以转换为文本框吗?
Dim rect As Rectangle
Dim bruh As New SolidBrush(Color.FromArgb(120, 0, 0, 225))
Dim gfx As Graphics = ListBox1.CreateGraphics
gfx.FillRectangle(bruh, rect)
推荐阅读
- sqlalchemy - 创建数据库会话后 Alembic 迁移挂起
- graphql - prism项目中放置环境变量时的问题
- c++ - 这是 C++ 中的双重免费吗
- amazon-s3 - 带有用于静态托管的 Amazon S3 存储桶的 CNAME 子域
- mysql - utf8mb4_unicode_ci 和 utf8mb4_unicode_nopad_ci 有什么区别?
- reactjs - 运行 gatsby develop 命令时找不到“gatsby-plugin-sharp”插件
- html - 图像溢出固定高度的 flex 容器
- html - 如何在 flexbox 中向上移动单个元素?
- reactjs - 在 IIS 10 上使用 React.js 运行 .net 核心 Web 应用程序时出错
- react-native - React Native 应用程序的初始屏幕上的排毒挂起