如何更改 TPageControl 上标签的方向?
我是 Delphi 的新手(再次强调 - 我在 1994 年就使用过 Delphi)。 我现在有 Delphi 2009 Pro。
来自Java,我发现对象继承非常晦涩。
我的用户想要选项卡位于左侧的选项卡式页面。 但是,TPageControl 不允许更改选项卡标签方向或方向。 他们希望标签上的文字从上到下阅读,字母旋转,这样它们就处于“正常”方向。 标签位于左侧,标签从下向上读取,字母旋转 90 度。 向左倾斜,并且倾向于将头向左倾斜以阅读标签。 我发现了标准 TPageControl VCL 的一些增强功能,为悬停和活动添加了图像、文本和颜色更改,但没有任何功能允许在选项卡上操纵字体方向或方向。
页面控制表应类似于:
P
一个
克
电子
1
P
一个
克
电子
2P
一个
克
电子
3
等等...
I'm new to Delphi (again - I used Delphi back in 1994). I now have Delphi 2009 Pro.
Coming from Java, I find the object inheritance very obscure.
My users want tabbed pages with the tabs on the left. But, the TPageControl doesn't allow the tab label direction or orientation to be changed. They want the words on the tabs to read top to bottom with the letters rotated so they are in a "normal" orientation. With the tabs on the left the labels read from the bottom up with the letters rotated 90 deg. to the left and there is a tendency to tilt your head to the left to read the tabs. I found several enhancements to the standard TPageControl VCL that add images, text and color changes for hover and active, but nothing that allows the manipulation of font direction or orientation on the tabs.
Page Control Tabls should look something like:
P
a
g
e
1
P
a
g
e
2
P
a
g
e
3
And so on...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
1.) 设置 TPageControl 属性:
2.) 使用以下 OnDrawTab 代码:
3.) 编译, 开始享受吧!
1.) set the TPageControl properties:
2.) use the following OnDrawTab code:
3.) compile, start and enjoy !
与其说是 DIY 答案,还想指出 Delphi 是一个基于组件的开发平台,并且有几个第三方 VCL 控件在渲染和主题控件方面提供了一些非常灵活的选项。
我自己使用过并推荐:
HTH 祝你好运
Not so much a DIY answer but also wanted to point out the Delphi is a component based development platform and there are several third party VCL controls that offer some very flexible options in rendering and themeing controls.
Ones I've used myself and would recommend:
HTH and good luck
正如 X-Ray 所说:您需要自行绘制标签。 这并不是那么困难,我以前已经这样做过,但我还没有准备好发布任何代码。 您将需要获取选项卡的画布并使用 TextOut 方法。
As X-Ray said: You need to owner draw the tabs. It's not really that difficult, I have done that before, but I haven't got any code ready to post. You will need to get the tab's canvas and use the TextOut method.