Click here to Skip to main content
16,018,949 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,
i want to know how can i change code from vb to c#?
here is my code:
VB
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 cant translate these code to c# like:
ScaleMode

Picture1.Line

Picture1.ScaleWidth / 2


any idea for translate these codes..?
tnx
GL
Posted

 
Share this answer
 
 
Share this answer
 
Comments
[no name] 24-Apr-13 13:48pm    
How does that help the OP translate VB6 code to C#?
Hello,

There are plenty of free online converters.

http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]

http://converter.telerik.com/[^]

Valery.
 
Share this answer
 
Comments
Thomas Daniels 24-Apr-13 13:03pm    
The code of the OP is VB code, not VB.NET. If I try to convert his code to C# using these translators, then I get <small>-- line 1 col 8: invalid NonModuleDeclaration</small>.

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