标题:[求助]怎么让label里面的字竖排,不好意思,这个问题有点白痴
只看楼主
gcwen
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-11-6
 问题点数:0 回复次数:14 
[求助]怎么让label里面的字竖排,不好意思,这个问题有点白痴

如题

搜索更多相关主题的帖子: label 竖排 
2006-11-17 21:45
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
得分:0 
一个文字后面都加一个 CHR(13)+CHR(10)

[GLOW=255,DeepPink,3]我的免费网盘[/GLOW]
2006-11-17 21:46
gcwen
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-11-6
得分:0 
学习VB才2天,不是这个意思,我要那种字也要旋转90度。
2006-11-17 22:00
gcwen
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-11-6
得分:0 
回复的时候为什么不能插入图片!
2006-11-17 22:03
gcwen
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-11-6
得分:0 
要这种!呵呵!
2006-11-17 22:04
gcwen
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-11-6
得分:0 

2006-11-17 22:04
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
得分:0 
....要用到API....


[CODE]Private Const LF_FACESIZE = 32 ' 最长的字体名称
Private Const SYSTEM_FONT = 13

Private Const VARIABLE_PITCH = 2 ' 字体族

Private Const FF_DONTCARE = 0 '
Private Const FF_ROMAN = 16 ' 字体宽度可变,Times Roman, Century ' Schoolbook等
Private Const FF_SWISS = 32 ' 宽度可变,带衬线,如Helvetica, Swiss等
Private Const FF_MODERN = 48 ' 具有规定的宽度,衬线可有可无,
' 如Pica, Elite, Courier等等.
Private Const FF_SCRIPT = 64 ' 手写体,如Cursive
Private Const FF_DECORATIVE = 80 ' 特殊字体,如Old English

'/*********************/
'/* 2. 类型声明部分 */
'/*********************/
Private Type LOGFONT
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
lfFaceName(LF_FACESIZE) As Byte
End Type



'/*********************/
'/* 4. 函数声明部分 */
'/*********************/
Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
Private Declare Function GDIGetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long

Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long


'******************************************
' hDestDC: 显示文字的控件句柄
' Text: 要显示的文字
' x, y: 显示文字的位置
' LineAngle: 角度
'******************************************
Private Sub RotPrint(ByVal hDestDC As Long, Text As String, x As Long, y As Long, LineAngle As Long)
Dim hFont As Long, hOldFont As Long, r As Long
Dim Font As LOGFONT

hOldFont = SelectObject(hDestDC, GetStockObject(SYSTEM_FONT))

GDIGetObject hOldFont, Len(Font), Font

' 填充LOGFONT结构
Font.lfEscapement = LineAngle

Font.lfPitchAndFamily = VARIABLE_PITCH Or FF_DONTCARE

' 创建字体
hFont = CreateFontIndirect(Font)

' 选择旋转字体
r = SelectObject(hDestDC, hFont)

' 显示字体
TextOut hDestDC, x, y, Text, lstrlen(Text)

' 恢复原字体
hFont = SelectObject(hDestDC, hOldFont)

' 删除创建的字体
DeleteObject hFont
End Sub

' 绘制
Private Sub Form_Paint()
Dim nAngle As Long

Cls
For nAngle = 20 To 90 Step 10
ForeColor = QBColor(nAngle / 10 - 2)
RotPrint hdc, VBCSTEXT, 10, 290, nAngle * 10
Next
End Sub [/CODE]

[GLOW=255,DeepPink,3]我的免费网盘[/GLOW]
2006-11-17 22:08
gcwen
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-11-6
得分:0 
吓死人啦!
2006-11-17 22:12
gcwen
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-11-6
得分:0 
我放弃了,就让它横着摆好了。
2006-11-17 22:14
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
得分:0 
呵呵~~~~

[GLOW=255,DeepPink,3]我的免费网盘[/GLOW]
2006-11-17 22:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-103714-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019982 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved