1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| Option Explicit
Public Sub Demo()
Dim T As Integer
Dim ValDec As Long
Dim LeMot As String
Dim Result As String
Dim ChaqueCaractere() As String
' le mot en russe codé unicode
' 042D 0414 0440 0430 0432 0441 0442 0432 0443 0439 0442 0435 0021
LeMot = "042D 0414 0440 0430 0432 0441 0442 0432 0443 0439 0442 0435 0021"
ChaqueCaractere = Split(LeMot, " ")
For T = 1 To UBound(ChaqueCaractere)
ValDec = CDbl("&H" & ChaqueCaractere(T))
If ValDec > 255 Then
Result = Result & ChrW(ValDec)
Else
Result = Result & Chr(ValDec)
End If
Next
MSHFlexGrid1.TextMatrix(0, 0) = Result
'un mot que tu pourras traduire à l'occasion
LeMot = "000D 000A 0420 0435 0448 0435 043D 0438 0435 0020 003F"
Result = ""
ChaqueCaractere = Split(LeMot, " ")
For T = 1 To UBound(ChaqueCaractere)
ValDec = CDbl("&H" & ChaqueCaractere(T))
If ValDec > 255 Then
Result = Result & ChrW(ValDec)
Else
Result = Result & Chr(ValDec)
End If
Next
MSHFlexGrid1.TextMatrix(0, 0) = MSHFlexGrid1.TextMatrix(0, 0) & Result
End Sub
Private Sub Form_Load()
Me.Height = 2250: Me.Width = 5385
MSHFlexGrid1.Move 60, 60, 5000, 1550
MSHFlexGrid1.Cols = 1
MSHFlexGrid1.FixedCols = 0
MSHFlexGrid1.Rows = 1
MSHFlexGrid1.FixedRows = 0
MSHFlexGrid1.GridLines = flexGridNone
MSHFlexGrid1.Font.Name = "MS sans serif"
MSHFlexGrid1.Font = "MS sans serif"
MSHFlexGrid1.Font.Size = 28
MSHFlexGrid1.ColWidth(0) = 5000
MSHFlexGrid1.RowHeight(0) = 1500
MSHFlexGrid1.WordWrap = True
Demo
End Sub |
Partager