Results 1 to 11 of 11

Thread: Converting Function from VB.NET - C#

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Converting Function from VB.NET - C#

    Anyone know how to make this function work?

    This is the function that i made a while back in VB.NET(Works) that writes to an RTB (rich Text Box).

    VB Code:
    1. Public Sub AddChat(ByVal ParamArray aT() As Object)
    2.  
    3.         Dim i As Integer
    4.  
    5.         With Chat
    6.             .SelectionStart = .Text.Length
    7.             .SelectionLength = 0
    8.         End With
    9.  
    10.         For i = 0 To UBound(aT) Step 2
    11.  
    12.             With Chat
    13.                 .SelectionColor = aT(i)
    14.                 .SelectedText = aT(i + 1)
    15.             End With
    16.  
    17.         Next i
    18.  
    19.  
    20.         With Chat
    21.  
    22.             .SelectionLength = 0
    23.             .SelectionStart = .Text.Length
    24.             .SelectedText = Microsoft.VisualBasic.ControlChars.CrLf
    25.  
    26.         End With
    27.  
    28.  
    29.  
    30.     End Sub


    to use the function in VB.NET

    it would be:
    VB Code:
    1. AddChat(Color.White, "Blah Blah Blah")


    How would this look in C#?
    Last edited by PlaGuE; May 15th, 2006 at 01:13 AM.
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width