好象有個(gè)StrReverse函數(shù)是直接反轉(zhuǎn)字符串的吧..
創(chuàng)新互聯(lián)建站服務(wù)項(xiàng)目包括金鳳網(wǎng)站建設(shè)、金鳳網(wǎng)站制作、金鳳網(wǎng)頁(yè)制作以及金鳳網(wǎng)絡(luò)營(yíng)銷(xiāo)策劃等。多年來(lái),我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,金鳳網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到金鳳省份的部分城市,未來(lái)相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
我平時(shí)用的是VB6.但是.NET中應(yīng)該也是可以用MID的
你注意看FOR 是從len-1到0的..而mid中是不允許出現(xiàn)0的..
你看看MID運(yùn)行不了時(shí),是不是返回I是0的時(shí)間
改成:
For i = Len(sstr) To 1 Step -1
試試了?
這個(gè)太簡(jiǎn)單了吧.
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控件內(nèi)的漢字文字向左(逆時(shí)針)轉(zhuǎn)90度,可對(duì)控件的Fonf屬性進(jìn)行設(shè)置,選有@前綴的漢字字體,并調(diào)整好Labei控件的尺寸,并對(duì)WordWrap 屬性和AutoSize 屬性進(jìn)行必要設(shè)置。
WordWrap 屬性
返回或設(shè)置一個(gè)值,該值用來(lái)指示一個(gè) AutoSize 屬性設(shè)置為 True 的 Label?
控件,是否要進(jìn)行水平或垂直展開(kāi)以適合其 Caption 屬性中指定的文本的要求。
AutoSize 屬性,返回或設(shè)置一個(gè)值,以決定控件是否自動(dòng)改變大小以顯示其全部?jī)?nèi)容。
為了決定 Label 控件如何顯示其內(nèi)容,應(yīng)使用此屬性。例如,一個(gè)動(dòng)態(tài)改變的圖形可能具有一個(gè)包含的文本也發(fā)生改變的Label。為了使 Label 保持水平方向尺寸不變并允許增加或減少文本,則應(yīng)將 WordWrap 和?AutoSize 屬性設(shè)置為 True。
幾乎沒(méi)有遇到過(guò)這個(gè)問(wèn)題。是WEB還是WINFORM的,如果是WEB,請(qǐng)用CSS控制一下
文字編輯結(jié)束后,選擇“移動(dòng)”工具(工具箱第一個(gè)工具,快捷鍵V),然后按Ctrl+T快捷鍵進(jìn)行“自由變換”,會(huì)在文字上出現(xiàn)控制框,把鼠標(biāo)移到控制框外邊指針就會(huì)變成旋轉(zhuǎn)的樣式,按住鼠標(biāo)左鍵拖動(dòng)就可以進(jìn)行任意角度旋轉(zhuǎn)了。
'加載一個(gè)圖片框,兩個(gè)文本框,兩個(gè)Label1,一個(gè)命令按鈕。
'一個(gè)文本時(shí)輸入你要顯示的字,一個(gè)是轉(zhuǎn)的角度,圖片框用來(lái)顯示后來(lái)的效果
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
'設(shè)置文本傾斜度
'設(shè)置字體參數(shù)
NewFont = CreateFontIndirect(RF)
'創(chuàng)建新字體
OldFont = SelectObject(Me.Picture1.hdc, NewFont)
'應(yīng)用新字體
x = Me.Picture1.ScaleWidth / 2
y = Me.Picture1.ScaleHeight / 2
'選擇顯示文本的起點(diǎn)
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
'設(shè)置字符高度
RF.lfWidth = 10
'設(shè)置字符平均寬度
RF.lfEscapement = 0
'設(shè)置文本傾斜度
RF.lfWeight = 400
'設(shè)置字體的輕重
RF.lfItalic = 0
'字體不傾斜
RF.lfUnderline = 0
'字體不加下劃線
RF.lfStrikeOut = 0
'字體不加刪除線
RF.lfOutPrecision = 0
'設(shè)置輸出精度
RF.lfClipPrecision = 0
'設(shè)置剪輯精度
RF.lfQuality = 0
'設(shè)置輸出質(zhì)量
RF.lfPitchAndFamily = 0
'設(shè)置字體的字距和字體族
RF.lfCharSet = 0
'設(shè)置字符集
RF.lfFaceName = "Arial" + Chr(0)
'設(shè)置字體名稱
Me.txtEscapement.Text = RF.lfEscapement / 10
End Sub
網(wǎng)頁(yè)名稱:vb.net中字體反了的簡(jiǎn)單介紹
分享鏈接:http://jinyejixie.com/article28/hehsjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、網(wǎng)站內(nèi)鏈、ChatGPT、品牌網(wǎng)站建設(shè)、營(yíng)銷(xiāo)型網(wǎng)站建設(shè)、移動(dòng)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)