Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have VB6 code but when it runs through VBNET incorrect.
Who helps me move on through the code with VBNET.
If you have it then send to mail: cuvancuoi@yahoo.com
Thanks!

VB6 code here:
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(1 To 32) As Byte
End Type
Private Type NONCLIENTMETRICS
cbSize As Long
iBorderWidth As Long
iScrollWidth As Long
iScrollHeight As Long
iCaptionWidth As Long
iCaptionHeight As Long
lfCaptionFont As LOGFONT
iSMCaptionWidth As Long
iSMCaptionHeight As Long
lfSMCaptionFont As LOGFONT
iMenuWidth As Long
iMenuHeight As Long
lfMenuFont As LOGFONT
lfStatusFont As LOGFONT
lfMessageFont As LOGFONT
End Type
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As NONCLIENTMETRICS, ByVal fuWinIni As Long) As Long
Private Sub Combo1_Click()
Dim ncm As NONCLIENTMETRICS
Dim Orincm As NONCLIENTMETRICS
Dim Returned As Long
Dim i As Integer
ncm.cbSize = Len(ncm)
Returned = SystemParametersInfo(41, 0, ncm, 0)
Orincm = ncm
For i = 1 To Len(Combo1.Text)
ncm.lfMessageFont.lfFaceName(i) = Asc(Mid(Combo1.Text, i, 1))
ncm.lfCaptionFont.lfFaceName(i) = Asc(Mid(Combo1.Text, i, 1))
Next i
ncm.lfMessageFont.lfFaceName(i) = 0
ncm.lfCaptionFont.lfFaceName(i) = 0
Returned = SystemParametersInfo(42, 0, ncm, &H1 Or &H2)
MsgBox "Message & Caption Font Changed To " & Combo1.Text, vbOKOnly, "NILESH"
Returned = SystemParametersInfo(42, 0, Orincm, &H1 Or &H2)
MsgBox "Message & Caption Font Replaced To " & StrConv(Orincm.lfCaptionFont.lfFaceName, vbUnicode), vbOKOnly, "NILESH"
End Sub
Private Sub Form_Load()
Dim i As Integer
Show
For i = 1 To 30
Combo1.AddItem Screen.Fonts(i)
Next i 
End Sub
Posted
Updated 18-Aug-10 18:03pm
v2

1 solution

What have you tried so far?
Noone will translate code for you. Post the problems you run into and someone can help you.
 
Share this answer
 
Comments
tanphat 19-Aug-10 10:31am    
I have tried to move through the code on VBNET but were unsuccessful, so I need help. If you know please save me move, thank you.
Hiren solanki 30-Aug-10 10:24am    
atleast you try for yourself try to resolve . and if same occurs again then point perticular problem to community.
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900