好象有个StrReverse函数是直接反转字符串的吧..
创新互联建站服务项目包括金凤网站建设、金凤网站制作、金凤网页制作以及金凤网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,金凤网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到金凤省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
我平时用的是VB6.但是.NET中应该也是可以用MID的
你注意看FOR 是从len-1到0的..而mid中是不允许出现0的..
你看看MID运行不了时,是不是返回I是0的时间
改成:
For i = Len(sstr) To 1 Step -1
试试了?
这个太简单了吧.
Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim style As FontStyle
If Me.CheckBox1.Checked Then
style = style Or FontStyle.Bold
End If
If Me.CheckBox2.Checked Then
style = style Or FontStyle.Italic
End If
If Me.CheckBox3.Checked Then
style = style Or FontStyle.Underline
End If
Dim myFont As Font = New Font(TextBox1.Text, 20, style, GraphicsUnit.Pixel)
If TextBox1.Text.ToLower "microsoft sans serif" And myFont.Name.ToLower = "microsoft sans serif" Then
MessageBox.Show("不存在该字体!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return
End If
Label1.Font = myFont
End Sub
Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.CheckBox1.Text = "黑体"
Me.CheckBox2.Text = "斜体"
Me.CheckBox3.Text = "下划线"
End Sub
End Class
VB的Label控件内的汉字文字向左(逆时针)转90度,可对控件的Fonf属性进行设置,选有@前缀的汉字字体,并调整好Labei控件的尺寸,并对WordWrap 属性和AutoSize 属性进行必要设置。
WordWrap 属性
返回或设置一个值,该值用来指示一个 AutoSize 属性设置为 True 的 Label
控件,是否要进行水平或垂直展开以适合其 Caption 属性中指定的文本的要求。
AutoSize 属性,返回或设置一个值,以决定控件是否自动改变大小以显示其全部内容。
为了决定 Label 控件如何显示其内容,应使用此属性。例如,一个动态改变的图形可能具有一个包含的文本也发生改变的Label。为了使 Label 保持水平方向尺寸不变并允许增加或减少文本,则应将 WordWrap 和 AutoSize 属性设置为 True。
几乎没有遇到过这个问题。是WEB还是WINFORM的,如果是WEB,请用CSS控制一下
文字编辑结束后,选择“移动”工具(工具箱第一个工具,快捷键V),然后按Ctrl+T快捷键进行“自由变换”,会在文字上出现控制框,把鼠标移到控制框外边指针就会变成旋转的样式,按住鼠标左键拖动就可以进行任意角度旋转了。
'加载一个图片框,两个文本框,两个Label1,一个命令按钮。
'一个文本时输入你要显示的字,一个是转的角度,图片框用来显示后来的效果
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 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 DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
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 As String * 50
End Type
Dim RF As LOGFONT
Dim NewFont As Long
Dim OldFont As Long
Private Sub Command_View_Click()
Dim Throw As Long
Me.Picture1.Cls
RF.lfEscapement = Int(Val(Me.txtEscapement.Text)) * 10
'设置文本倾斜度
'设置字体参数
NewFont = CreateFontIndirect(RF)
'创建新字体
OldFont = SelectObject(Me.Picture1.hdc, NewFont)
'应用新字体
x = Me.Picture1.ScaleWidth / 2
y = Me.Picture1.ScaleHeight / 2
'选择显示文本的起点
Throw = TextOut(Me.Picture1.hdc, x, y, Me.Text_Input.Text, _
Len(Me.Text_Input.Text))
'显示文本
NewFont = SelectObject(Me.Picture1.hdc, OldFont)
'选择旧字体
Throw = DeleteObject(NewFont)
'删除新字体
End Sub
Private Sub Form_Load()
SetBkMode Me.Picture1.hdc, 1
RF.lfHeight = 50
'设置字符高度
RF.lfWidth = 10
'设置字符平均宽度
RF.lfEscapement = 0
'设置文本倾斜度
RF.lfWeight = 400
'设置字体的轻重
RF.lfItalic = 0
'字体不倾斜
RF.lfUnderline = 0
'字体不加下划线
RF.lfStrikeOut = 0
'字体不加删除线
RF.lfOutPrecision = 0
'设置输出精度
RF.lfClipPrecision = 0
'设置剪辑精度
RF.lfQuality = 0
'设置输出质量
RF.lfPitchAndFamily = 0
'设置字体的字距和字体族
RF.lfCharSet = 0
'设置字符集
RF.lfFaceName = "Arial" + Chr(0)
'设置字体名称
Me.txtEscapement.Text = RF.lfEscapement / 10
End Sub