将VB6转换为VBNET .....帮助我 [英] Convert VB6 to VBNET.....help me

查看:87
本文介绍了将VB6转换为VBNET .....帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有VB6代码,但通过VBNET运行时不正确.
谁能帮助我继续使用VBNET遍历代码.
如果有,请发送至邮件:cuvancuoi@yahoo.com
谢谢!

这里的VB6代码:

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

推荐答案

您到目前为止尝试了什么?
没有人会为您翻译代码.发布您遇到的问题,有人可以为您提供帮助.
What have you tried so far?
Noone will translate code for you. Post the problems you run into and someone can help you.


这篇关于将VB6转换为VBNET .....帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆