RTB Writeln Function

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

RTB Writeln Function
  1. Unread #1 - Aug 28, 2011 at 1:31 PM
  2. Terrankiller
    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    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]
     
  3. Unread #2 - Sep 3, 2011 at 2:24 AM
  4. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    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 :)
     
  5. Unread #3 - Sep 3, 2011 at 3:53 AM
  6. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    RTB Writeln Function

    I'd be very interested to see the finished product. Really good idea with the Writeln function too. Keep it up.
     
  7. Unread #4 - Sep 5, 2011 at 6:24 AM
  8. Terrankiller
    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    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? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site