将代码从Vb转换为C# [英] Translate Code from Vb To C#
本文介绍了将代码从Vb转换为C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i想知道如何将代码从vb更改为c#?
这里是我的代码:
Hi ,
i want to know how can i change code from vb to c#?
here is my code:
Public Declare Function SetCapture Lib "user32.dll" (ByVal hWnd As Long) As Long
Public Declare Function ReleaseCapture Lib "user32.dll" () As Long
Private Sub Form1_Load()
Dim retval As Long ' return value
retval = SetCapture(Picture1.hWnd)
Picture1.ScaleMode = 3
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static oldX As Long, oldY As Long ' the previous mouse coordinates
Picture1.Line (Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2)-(oldX, oldY), _
Picture1.BackColor
Picture1.Line (Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2)-(X, Y)
oldX = X: oldY = Y
End Sub
Private Sub Picture1_Click()
Dim retval As Long
retval = ReleaseCapture()
End Sub
i不能将这些代码翻译成c#,如:
i cant translate these code to c# like:
ScaleMode
Picture1.Line
Picture1.ScaleWidth / 2
翻译这些代码的任何想法..?
tnx
GL
any idea for translate these codes..?
tnx
GL
推荐答案
您好,
有很多免费的在线转换器。
http://www.developerfusion .com / tools / convert / vb-to-csharp / [ ^ ]
http://转换器.telerik.com / [ ^ ]
Valery。
Hello,
There are plenty of free online converters.
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]
http://converter.telerik.com/[^]
Valery.
http:// www。 carlosag.net/tools/codetranslator/ [ ^ ]
通过这些 -
.NET代码转换 - 转换代码 [ ^ ]
代码转换C#和VB.NET的Visual Studio外接程序 [ ^ ]
这篇关于将代码从Vb转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文