vb.net - Windows 窗体中的自动换行 (vb.net)

标签 vb.net winforms word-wrap

如何在 Visual Basic .NET 2005 中使用 DrawString 创建自动换行效果?

最佳答案

http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=286

You can draw text in a rectangle by passing a RectangleF object to the DrawString method. GDI+ will wrap the text to make it fit in the specified rectangle. For example:

Dim s As String = "This string will be wrapped in the output rectangle"
Dim rectf As New RectangleF(10, 100, 200, 200)
grf.DrawString(s, myFont, Brushes.Red, rectf)

关于vb.net - Windows 窗体中的自动换行 (vb.net),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/788311/

相关文章:

c# - 将字符串从 datagridview 传递到另一种形式的文本框

html - 包裹在 div 容器内的表格

c# - 如何计算字符串中的Enter?

c# - Numericupdown 鼠标滚轮事件将 decimal 增加多于一个增量

.net - 如何在显示 UAC 对话框窗口时运行我的应用程序?

vb.net - VB.NET:无法从资源加载音频

c# - 多行文本作为 Windows 窗体中的按钮标签

java - Java 7 中的 JEditorPane 换行

vb.net - 查找连接我的设备的串行端口

sql - 计算 SQL 表中超过 1 行出现 2 个不同值的次数