我有一个 TableLayoutPanel,其中 TableLayoutPanels 作为行。每个内部 tableLayoutPanels 都有两行。第二行是一个textBox
以斜体形式显示的 URL 。但是 url 的高度被截断了,像 'g' 这样的字符会丢失一些像素,而 '_' 根本没有显示。
所以我试图改变文本框的高度 - 没有改变 - 试图改变内部 tableLayoutPanel 的行大小 - 没有改变 - 试图改变内部 tableLayoutPanel 的大小本身 - 没有改变......
具有讽刺意味的是,在同一行中还有另一个带有斜体文本的标签,它绑定到每个锚点的行底部,但即使我在 textBox 上使用锚点,它仍然被截断。
相关的文本框代码:
textBox2.Font = new System.Drawing.Font("Arial", 9.75F,
System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point,
((byte)(0)));
textBox2.Location = new System.Drawing.Point(3, 21);
textBox2.Size = new System.Drawing.Size(454, 23);
内部tlp代码:
tableLayoutPanel2.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent,
80F));
tableLayoutPanel2.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute,
27F));
tableLayoutPanel2.Size = new System.Drawing.Size(607, 44);
是否可以以某种方式显示斜体下划线:(原为 8OG8vit_-Wg)
编辑:将文本框放在它的外部 groupbox 和主窗体上。
System.Windows.Forms.TextBox textBox2 = new System.Windows.Forms.TextBox();
textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None;
textBox2.Cursor = System.Windows.Forms.Cursors.IBeam;
textBox2.Font = new System.Drawing.Font("Arial", 9.75F,
System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point,
((byte)(0)));
textBox2.Location = new System.Drawing.Point(100, 290);
textBox2.Name = "textBox2";
textBox2.ReadOnly = true;
textBox2.Size = new System.Drawing.Size(454, 15);
textBox2.Text = "8OG8vit_-Wg";
textBox2.BackColor = System.Drawing.Color.Coral;
groupBox1.Controls.Add(textBox2); // this.Controls.Add(textBox2);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句