文本方向 Flexgrid
有没有办法像 Excel 一样在垂直方向上对齐 msflexgrid 中的文本?
谢谢
Is there anyway to align the text in msflexgrid in vertical orientation like excel does?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将字体旋转 90 度有很多作用。 VB6 使用 stdole2 类型库的 OLE StdFont 对象部分。
您必须将 StdFont 转换为 GDI 字体才能对其进行操作。
这是一篇非常好的文章(Text At Any Angle)和示例代码继续执行此操作。
该示例在表单上绘图,但我认为您可以获取 MSFlexGrid 的句柄并在其中进行绘制。
然后,您可以控制绘制文本的时间和方式。如果您想在运行时编辑垂直文本,则可以在编辑文本时在单元格上显示水平文本框,然后在完成编辑后绘制新文本。
There is a lot to rotating Fonts by 90 degrees. VB6 uses an OLE StdFont object part of the stdole2 type library.
You will have to convert the StdFont into a GDI font to be able to manipulated it.
Here is a very nice post (Text At Any Angle) with sample code to go on doing exactly that.
The sample is drawing on a form, but I would think you can get a handle to a MSFlexGrid and draw into that.
You can then control when and how the text is drawn. If you want to edit the vertical text at runtime, you can show a horizontal textbox over the cell instead while editing the text and then draw the new text when finished editing.
如果您谈论的是文本的垂直旋转,则不是。
您可以将文本转换为旋转图像,然后加载图像。
进一步...
您可以将旋转文本打印到图片框控件,然后将图片框分配给单元格。
此链接显示了该方法的类似用法,但原因略有不同。
http://vb.mvps.org/articles/ap199907.pdf
Not if you are talking about vertical rotation of text.
You could convert your text into a rotated image and then load the image.
Further on this...
You can print rotated text to a picturebox control and then assign the picturebox to a cell.
This link shows a similar usage of the method but for a slightly different reason.
http://vb.mvps.org/articles/ap199907.pdf
没有任何内置内容,但这是我几年前使用的一个技巧。您将一个字符串传递给该函数,它会传回一个字符串,每个字符后带有回车符和换行符。
Nothing built-in, but here is a hack I used a few years back. You pass in a string to the function and it passes back a string with a carriage return and line feed after every character.