PDA

View Full Version : Convert VB to C#



phiphap
01-09-2009, 17:02
Các bác cho em hỏi trong vb có class Collection ( không biết có đúng không)
khi convert sang C# thì collection nó tương đương với gì bên C#
Help me pleae!!!!!!!!!!!!!!!!!!! thank nhiều.( mình sử dụng arraylist mà hình như không đúng.

trannghiand
05-10-2009, 21:11
Em có một đoạn code vb muốn chuyển sang C#. Bác nào giúp em với!

Public Sub Mouse_Down(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim C As Panel
C = CType(sender, TextBox).Parent
If e.Button = MouseButtons.Left Then
m_IsDragging = True
C.Cursor = Cursors.SizeAll
mou*** = -e.X
mousey = -e.Y
Dim clipleft As Integer = C.PointToClient(MousePosition).X - CType(sender, TextBox).Location.X
Dim cliptop As Integer = C.PointToClient(MousePosition).Y - CType(sender, TextBox).Location.Y
Dim clipwidth As Integer = C.ClientSize.Width - (CType(sender, TextBox).Width - clipleft)
Dim clipheight As Integer = C.ClientSize.Height - (CType(sender, TextBox).Height - cliptop)
Cursor.Clip = C.RectangleToScreen(New Rectangle(clipleft, cliptop, clipwidth, clipheight))
CType(sender, TextBox).Invalidate()
End If
End Sub

Thanks các bác rất nhiều!