Damian666 Posted October 8, 2015 Share Posted October 8, 2015 so... im trying to get colored chatlines instead of the boring black on white, i tried lots of shit, but it just doesnt work xd   Public Sub AddText2(ByVal Msg As String, ByVal Color As Long)     With frmMainGame.txtChat2       .SelectionColor = Drawing.ColorTranslator.FromOle(QBColor(Color))       .AppendText(Msg)       .SelectionColor = Drawing.ColorTranslator.FromOle(QBColor(Color))       .AppendText(Msg & vbNewLine)     End With   End Sub    Public Sub AddText2(ByVal Msg As String, ByVal Color As Long)     Dim s As String     Dim C As Integer     s = vbNewLine & Msg     C = frmMainGame.txtChat2.SelectionStart     frmMainGame.txtChat2.SelectionStart = Len(frmMainGame.txtChat2.Text)     frmMainGame.txtChat2.SelectionColor = Drawing.ColorTranslator.FromOle(QBColor(Color))     frmMainGame.txtChat2.SelectedText = s     frmMainGame.txtChat2.SelectionStart = Len(frmMainGame.txtChat2.Text) - 1   End Sub  both subs do nothing at all, stuff gets processed fine in the sub, but nothing shows >.< help? Link to comment Share on other sites More sharing options...
Python Panda Posted October 8, 2015 Share Posted October 8, 2015 Here is some code translated from C# from a school project I did. Not sure if it will help. Also what is Drawing.ColorTranslator.FromOle??? Never seen nor used it before... Dim length As Integer = richTextBox.TextLength ' at end of text richTextBox.AppendText(mystring) richTextBox.SelectionStart = length richTextBox.SelectionLength = mystring.Length richTextBox.SelectionColor = Color.Red  Though I have no idea if it will work in vb.net as it was meant to be C#... Link to comment Share on other sites More sharing options...
Damian666 Posted October 8, 2015 Author Share Posted October 8, 2015 thanx, but sadly that didnt work either Link to comment Share on other sites More sharing options...
Damian666 Posted October 9, 2015 Author Share Posted October 9, 2015 woot, found it... it was a threading problem... again xd Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now