Adblock breaks this site

RTB Writeln Function

Discussion in 'Programming General' started by Terrankiller, Aug 28, 2011.

  1. Terrankiller

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1
    RTB Writeln Function

    I am currently developing an open source IRC server and I am using a Rich Text Box control as a console to display data. This function will append the specified rtb using the specified text, font, font size, color, and style.

    Code:
    Public Sub Writeln(ByRef RTB As RichTextBox, ByVal sText As String, ByVal sFont As String, ByVal fSize As Integer, ByVal fColor As Color, ByVal fStyle As FontStyle)
    
       RTB.SelectionColor = fColor
       RTB.SelectionFont = New Font(sFont, fSize, fStyle)
       RTB.AppendText(sText & vbNewLine)
    
    End Sub
    
    An example use:

    Code:
    Writeln(RichTextBox1, "Hello World!", "Verdana", 8, Color.Red, 1)
    Writeln(RichTextBox1, "This", "Verdana", 8, Color.Blue, 2)
    Writeln(RichTextBox1, "is", "Verdana", 8, Color.Green, 3)
    Writeln(RichTextBox1, "a", "Verdana", 8, Color.Orange, 4)
    Writeln(RichTextBox1, "test!", "Verdana", 8, Color.Yellow, 5)
    
    Picture of the example:

    [​IMG]
     
  2. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    RTB Writeln Function

    Pretty smooth ;)
    Are you making a whole server or just a client?

    And if you need a hand here and there just send a message my way or post here and i'll help. I don't mind a little project here and there to sharpen my dwindling skills :)
     
  3. Darthatron

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0
    RTB Writeln Function

    I'd be very interested to see the finished product. Really good idea with the Writeln function too. Keep it up.
     
  4. Terrankiller

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1
    RTB Writeln Function

    I am developing a server and client. I am trying to figure out the best way to go about programming both using the .net socket library.
     
< Windows Application or Console Application? | What programming should I learn first? >


 
 
Adblock breaks this site